正在显示
3 个修改的文件
包含
8 行增加
和
8 行删除
| @@ -139,13 +139,13 @@ class ProjectUserController extends BaseController | @@ -139,13 +139,13 @@ class ProjectUserController extends BaseController | ||
| 139 | * @time :2023/8/29 13:47 | 139 | * @time :2023/8/29 13:47 |
| 140 | */ | 140 | */ |
| 141 | public function getRole(){ | 141 | public function getRole(){ |
| 142 | - $this->request->validate([ | ||
| 143 | - 'project_id'=>'required', | ||
| 144 | - ],[ | ||
| 145 | - 'project_id.required' => 'project_id不能为空', | ||
| 146 | - ]); | ||
| 147 | $roleModel = new ProjectRole(); | 142 | $roleModel = new ProjectRole(); |
| 148 | - $list = $roleModel->list($this->map); | 143 | + $list = $roleModel->lists($this->map,$this->page,$this->row,$this->order); |
| 144 | + $projectModel = new Project(); | ||
| 145 | + foreach ($list['list'] as $k => $v){ | ||
| 146 | + $v['project_name'] = $projectModel->getProjectName($v['project_id']); | ||
| 147 | + $list['list'][$k] = $v; | ||
| 148 | + } | ||
| 149 | $this->response('success',Code::SUCCESS,$list); | 149 | $this->response('success',Code::SUCCESS,$list); |
| 150 | } | 150 | } |
| 151 | 151 |
| @@ -36,7 +36,7 @@ class ProjectRoleController extends BaseController | @@ -36,7 +36,7 @@ class ProjectRoleController extends BaseController | ||
| 36 | */ | 36 | */ |
| 37 | public function get_user_list(){ | 37 | public function get_user_list(){ |
| 38 | $userModel = new UserModel(); | 38 | $userModel = new UserModel(); |
| 39 | - $list = $userModel->list(['role_id'=>$this->param['id']],'id',['id','name','mobile']); | 39 | + $list = $userModel->list(['role_id'=>$this->param['id'],'project_id'=>$this->user['project_id']],'id',['id','name','mobile']); |
| 40 | $this->response('success',Code::SUCCESS,$list); | 40 | $this->response('success',Code::SUCCESS,$list); |
| 41 | } | 41 | } |
| 42 | /** | 42 | /** |
| @@ -378,7 +378,7 @@ class Project extends Base | @@ -378,7 +378,7 @@ class Project extends Base | ||
| 378 | public function getProjectName($id){ | 378 | public function getProjectName($id){ |
| 379 | $title = ''; | 379 | $title = ''; |
| 380 | if(!empty($id)){ | 380 | if(!empty($id)){ |
| 381 | - $info = $this->read(['id'=>$id]); | 381 | + $info = $this->read(['id'=>$id],['title']); |
| 382 | if($info !== false){ | 382 | if($info !== false){ |
| 383 | $title = $info['title']; | 383 | $title = $info['title']; |
| 384 | } | 384 | } |
-
请 注册 或 登录 后发表评论