推荐人调整

main
limu 11 months ago
parent fdfae0e339
commit 77f4ecfcdf
  1. 10
      app/controller/api/user/User.php

@ -360,6 +360,7 @@ class User extends BaseController
$card = $this->request->param('card') ?? ''; $card = $this->request->param('card') ?? '';
$spread_phone = $this->request->param('spread_phone') ?? ''; $spread_phone = $this->request->param('spread_phone') ?? '';
$real_name = $this->request->param('real_name') ?? ''; $real_name = $this->request->param('real_name') ?? '';
$spread_uid2 = $this->request->param('spread_uid2') ?? '';
$user = userModel::getDB()->where('uid',$this->user->uid)->find(); $user = userModel::getDB()->where('uid',$this->user->uid)->find();
if(!empty($age)){ if(!empty($age)){
@ -378,10 +379,17 @@ class User extends BaseController
if(!empty($spread_phone)){ if(!empty($spread_phone)){
$a = userModel::getDB()->where('phone',$spread_phone)->find(); $a = userModel::getDB()->where('phone',$spread_phone)->find();
if(!$a){ if(!$a){
return app('json')->fail('查无此推荐人'); return app('json')->fail('查无此辅导员');
} }
$user->spread_uid = $a->uid; $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(); $user->save();
return app('json')->success('更新成功'); return app('json')->success('更新成功');

Loading…
Cancel
Save