Browse Source

新的下载页,openinstall,邀请码不能报错

lizhen_gitee 6 tháng trước cách đây
mục cha
commit
7969fbeb09
1 tập tin đã thay đổi với 18 bổ sung14 xóa
  1. 18 14
      application/api/controller/User.php

+ 18 - 14
application/api/controller/User.php

@@ -389,24 +389,28 @@ class User extends Api
 
         if(isset($data['introcode']) && !empty($data['introcode'])){
             $intro_user = Db::name('user')->where('introcode',$data['introcode'])->value('id');
-            if(!$intro_user){
+            /*if(!$intro_user){
                 $this->error('不存在的邀请人');
             }
             if(!empty($this->auth->intro_uid)){
                 $this->error('您已经填写过邀请人');
-            }
-            unset($data['introcode']);//别人的邀请码,不能改了自己的
-            $data['intro_uid'] = $intro_user;
-
-            //邀请用户注册,给邀请人奖励
-            if(isset($data['intro_uid']) && !empty($data['intro_uid'])){
-                $intro_money = config('site.intro_newuser_gift_moneynum') ?: 0;
-                if($intro_money > 0){
-                    $wallet_rs = model('wallet')->lockChangeAccountRemain($data['intro_uid'],'money',$intro_money,63,'邀请'.$this->auth->username);
-                    if($wallet_rs['status'] === false){
-                        Db::rollback();
-                        $this->setError($wallet_rs['msg']);
-                        return false;
+            }*/
+
+            if($intro_user && empty($this->auth->intro_uid)){
+
+                unset($data['introcode']);//别人的邀请码,不能改了自己的
+                $data['intro_uid'] = $intro_user;
+
+                //邀请用户注册,给邀请人奖励
+                if(isset($data['intro_uid']) && !empty($data['intro_uid'])){
+                    $intro_money = config('site.intro_newuser_gift_moneynum') ?: 0;
+                    if($intro_money > 0){
+                        $wallet_rs = model('wallet')->lockChangeAccountRemain($data['intro_uid'],'money',$intro_money,63,'邀请'.$this->auth->username);
+                        if($wallet_rs['status'] === false){
+                            /*Db::rollback();
+                            $this->error($wallet_rs['msg']);*/
+
+                        }
                     }
                 }
             }