|
@@ -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']);*/
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|