正在显示
1 个修改的文件
包含
4 行增加
和
2 行删除
| @@ -382,8 +382,8 @@ class ProjectLogic extends BaseLogic | @@ -382,8 +382,8 @@ class ProjectLogic extends BaseLogic | ||
| 382 | */ | 382 | */ |
| 383 | public function createUser($mobile,$project_id,$lead_name){ | 383 | public function createUser($mobile,$project_id,$lead_name){ |
| 384 | $userModel = new UserModel(); | 384 | $userModel = new UserModel(); |
| 385 | - //查看当前用户是否存在 | ||
| 386 | - $info = $userModel->read(['mobile'=>$mobile,'project_id'=>$project_id]); | 385 | + //查看当前项目是否存在超级管理员 |
| 386 | + $info = $userModel->read(['role_id'=>0,'project_id'=>$project_id]); | ||
| 387 | if($info === false){ | 387 | if($info === false){ |
| 388 | $data = [ | 388 | $data = [ |
| 389 | 'mobile'=>$mobile, | 389 | 'mobile'=>$mobile, |
| @@ -395,6 +395,8 @@ class ProjectLogic extends BaseLogic | @@ -395,6 +395,8 @@ class ProjectLogic extends BaseLogic | ||
| 395 | 'create_id'=>$this->manager['id'] ?? 0, | 395 | 'create_id'=>$this->manager['id'] ?? 0, |
| 396 | ]; | 396 | ]; |
| 397 | $userModel->add($data); | 397 | $userModel->add($data); |
| 398 | + }else{ | ||
| 399 | + $userModel->edit(['mobile'=>$mobile,'name'=>$lead_name],['id'=>$info['id']]); | ||
| 398 | } | 400 | } |
| 399 | return $this->success(); | 401 | return $this->success(); |
| 400 | } | 402 | } |
-
请 注册 或 登录 后发表评论