|
@@ -139,6 +139,10 @@ class User extends Api
|
|
|
}
|
|
|
$user_id = $this->auth->id;
|
|
|
|
|
|
+ if(!empty($this->auth->pre_userid)){
|
|
|
+ $this->error('您已经填写过邀请人');
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
$inviteUserInfo = \app\common\model\User::where(["invite_no" => $invite_no])->find();
|
|
|
if (!$inviteUserInfo) {
|
|
@@ -149,7 +153,9 @@ class User extends Api
|
|
|
throw new Exception('对方已被您邀请过');
|
|
|
}
|
|
|
if ($inviteUserInfo->id == $user_id) $this->error("不能邀请自己哦!");
|
|
|
- if ($inviteUserInfo->is_auth != 2) $this->error("该邀请码用户尚未完成实名认证");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
$res = \app\common\model\User::update(["pre_userid" => $inviteUserInfo->id], ["id" => $user_id]);
|
|
|
if ($res) {
|
|
@@ -202,30 +208,7 @@ class User extends Api
|
|
|
$data[$field] = $newone;
|
|
|
}
|
|
|
|
|
|
- if(isset($data['invite_no']) && !empty($data['invite_no'])){
|
|
|
- $intro_user = Db::name('user')->where('invite_no',$data['invite_no'])->value('id');
|
|
|
- if(!$intro_user){
|
|
|
- $this->error('不存在的邀请人');
|
|
|
- }
|
|
|
- if(!empty($this->auth->pre_userid)){
|
|
|
- $this->error('您已经填写过邀请人');
|
|
|
- }
|
|
|
- unset($data['invite_no']);
|
|
|
- $data['pre_userid'] = $intro_user;
|
|
|
-
|
|
|
-
|
|
|
- if(isset($data['pre_userid']) && !empty($data['pre_userid'])){
|
|
|
-
|
|
|
- if($intro_gold > 0){
|
|
|
- $wallet_rs = model('wallet')->lockChangeAccountRemain();
|
|
|
- if($wallet_rs['status'] === false){
|
|
|
- Db::rollback();
|
|
|
- $this->setError($wallet_rs['msg']);
|
|
|
- return false;
|
|
|
- }
|
|
|
- }*/
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
if(empty($data)){
|
|
|
$this->error('没有任何改变');
|
|
|
}
|