推荐人调整

main
limu 1 year ago
parent 77f4ecfcdf
commit 29d6290f8a
  1. 12
      app/controller/api/user/User.php

@ -381,14 +381,20 @@ class User extends BaseController
if(!$a){
return app('json')->fail('查无此辅导员');
}
if($this->user->uid == $a->uid){
return app('json')->fail('辅导员不能是自己');
}
$user->spread_uid = $a->uid;
}
if(!empty($spread_uid2)){
$a = userModel::getDB()->where('uid',$spread_uid2)->find();
if(!$a){
$b = userModel::getDB()->where('phone',$spread_uid2)->find();
if(!$b){
return app('json')->fail('查无此推荐人');
}
$user->spread_uid2 = $spread_uid2;
if($this->user->uid == $b->uid){
return app('json')->fail('推荐人不能是自己');
}
$user->spread_uid2 = $b->uid;
}
$user->save();

Loading…
Cancel
Save