diff --git a/app/controller/api/user/User.php b/app/controller/api/user/User.php index 4dbbf0d..f6d0c6b 100644 --- a/app/controller/api/user/User.php +++ b/app/controller/api/user/User.php @@ -360,6 +360,7 @@ class User extends BaseController $card = $this->request->param('card') ?? ''; $spread_phone = $this->request->param('spread_phone') ?? ''; $real_name = $this->request->param('real_name') ?? ''; + $spread_uid2 = $this->request->param('spread_uid2') ?? ''; $user = userModel::getDB()->where('uid',$this->user->uid)->find(); if(!empty($age)){ @@ -378,10 +379,17 @@ class User extends BaseController if(!empty($spread_phone)){ $a = userModel::getDB()->where('phone',$spread_phone)->find(); if(!$a){ - return app('json')->fail('查无此推荐人'); + return app('json')->fail('查无此辅导员'); } $user->spread_uid = $a->uid; } + if(!empty($spread_uid2)){ + $a = userModel::getDB()->where('uid',$spread_uid2)->find(); + if(!$a){ + return app('json')->fail('查无此推荐人'); + } + $user->spread_uid2 = $spread_uid2; + } $user->save(); return app('json')->success('更新成功');