|
...
|
...
|
@@ -30,20 +30,40 @@ class ProjectUserController extends BaseController |
|
|
|
*/
|
|
|
|
public function lists(){
|
|
|
|
$userModel = new UserModel();
|
|
|
|
$this->map['role_id'] = $this::ROLE_ID;//超级管理员管理
|
|
|
|
$lists = $userModel->lists($this->map,$this->page,$this->row,$this->order);
|
|
|
|
if(!empty($lists)){
|
|
|
|
foreach ($lists['list'] as $k => $v){
|
|
|
|
$userModel = new UserModel();
|
|
|
|
$lists['list'][$k]['operator_name'] = $userModel->read(['id'=>$v['operator_id']],['name'])['name'];
|
|
|
|
$lists['list'][$k]['project_name'] = (new Project())->read(['id'=>$v['project_id']],['title'])['title'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$query = $userModel->leftJoin('gl_project', 'gl_project_user.project_id', '=', 'gl_project.id')->where('gl_project_role.role_id',$this::ROLE_ID);
|
|
|
|
$query = $query->searchParam($query);
|
|
|
|
$lists = $query->paginate($this->row, $this->selectParam(), 'page', $this->page);
|
|
|
|
$this->response('列表',Code::SUCCESS,$lists);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param UserLogic $userLogic
|
|
|
|
* @remark :查询字段
|
|
|
|
* @name :selectParam
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/4 11:44
|
|
|
|
*/
|
|
|
|
public function selectParam(){
|
|
|
|
$select = [
|
|
|
|
'gl_project_user.id AS id',
|
|
|
|
'gl_project.title AS title',
|
|
|
|
'gl_project_user.project_id AS project_id',
|
|
|
|
'gl_project_user.mobile AS mobile',
|
|
|
|
'gl_project_user.email AS email',
|
|
|
|
'gl_project_user.status AS status',
|
|
|
|
];
|
|
|
|
return $select;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function searchParam(&$query){
|
|
|
|
//搜索条件处理
|
|
|
|
if(isset($this->map['title'])){
|
|
|
|
$query = $query->where('gl_project.title','like','%'.$this->map['title'].'%');
|
|
|
|
}
|
|
|
|
return $query;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :用户详情
|
|
|
|
* @name :info
|
|
|
|
* @author :lyh
|
...
|
...
|
|