|
...
|
...
|
@@ -382,8 +382,8 @@ class ProjectLogic extends BaseLogic |
|
|
|
*/
|
|
|
|
public function createUser($mobile,$project_id,$lead_name){
|
|
|
|
$userModel = new UserModel();
|
|
|
|
//查看当前用户是否存在
|
|
|
|
$info = $userModel->read(['mobile'=>$mobile,'project_id'=>$project_id]);
|
|
|
|
//查看当前项目是否存在超级管理员
|
|
|
|
$info = $userModel->read(['role_id'=>0,'project_id'=>$project_id]);
|
|
|
|
if($info === false){
|
|
|
|
$data = [
|
|
|
|
'mobile'=>$mobile,
|
|
...
|
...
|
@@ -395,6 +395,8 @@ class ProjectLogic extends BaseLogic |
|
|
|
'create_id'=>$this->manager['id'] ?? 0,
|
|
|
|
];
|
|
|
|
$userModel->add($data);
|
|
|
|
}else{
|
|
|
|
$userModel->edit(['mobile'=>$mobile,'name'=>$lead_name],['id'=>$info['id']]);
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
...
|
...
|
|