|
|
|
@ -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(); |
|
|
|
|