|
...
|
...
|
@@ -12,7 +12,7 @@ class DeptUserController extends BaseController |
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @param ViewDeptUser $viewDeptUser
|
|
|
|
* @name :(列表)lists
|
|
|
|
* @name :(部门获取成员列表)lists
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/5/17 17:27
|
|
...
|
...
|
@@ -23,26 +23,75 @@ class DeptUserController extends BaseController |
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :(获取成员列表)get_user_list
|
|
|
|
* @param ViewDeptUser $viewDeptUser
|
|
|
|
* @name :(详情)info
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/5/17 17:38
|
|
|
|
* @time :2023/5/18 9:32
|
|
|
|
*/
|
|
|
|
public function get_user_list(DeptUserLogic $deptUserLogic){
|
|
|
|
//获取当前用户已添加的成员
|
|
|
|
$list = $deptUserLogic->get_user_list();
|
|
|
|
$this->response('success',Code::SUCCESS,$list);
|
|
|
|
public function info(ViewDeptUser $viewDeptUser){
|
|
|
|
$this->request->validate([
|
|
|
|
'id'=>['required']
|
|
|
|
],[
|
|
|
|
'id.required' => 'id不能为空'
|
|
|
|
]);
|
|
|
|
$info = $viewDeptUser->read($this->param);
|
|
|
|
$this->response('success',Code::SUCCESS,$info);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :(添加或编辑成员)save
|
|
|
|
* @name :(部门添加用户)add
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/5/17 17:36
|
|
|
|
*/
|
|
|
|
public function add(DeptUserLogic $deptUserLogic){
|
|
|
|
$this->param['project_id'] = $this->user['project_id'];
|
|
|
|
$this->request->validate([
|
|
|
|
'dept_id'=>['required'],
|
|
|
|
'user_id'=>['required']
|
|
|
|
],[
|
|
|
|
'dept_id.required' => '组织架构id不能为空',
|
|
|
|
'user_id.required' => '用户id不能为空',
|
|
|
|
]);
|
|
|
|
$deptUserLogic->dept_user_add();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :(编辑成员)edit
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/5/18 9:19
|
|
|
|
*/
|
|
|
|
public function edit(DeptUserLogic $deptUserLogic){
|
|
|
|
$this->request->validate([
|
|
|
|
'id'=>['required'],
|
|
|
|
'dept_id'=>['required'],
|
|
|
|
],[
|
|
|
|
'id.required' => 'id不能为空',
|
|
|
|
'dept_id.required' => '组织架构id不能为空',
|
|
|
|
]);
|
|
|
|
$deptUserLogic->dept_user_edit();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :(设置管理员)set_admin
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/5/18 10:32
|
|
|
|
*/
|
|
|
|
public function set_admin(DeptUserLogic $deptUserLogic){
|
|
|
|
$this->request->validate([
|
|
|
|
'id'=>['required'],
|
|
|
|
'is_admin'=>['required'],
|
|
|
|
],[
|
|
|
|
'id.required' => 'id不能为空',
|
|
|
|
'is_admin.required' => 'is_admin不能为空',
|
|
|
|
]);
|
|
|
|
$deptUserLogic->dept_user_edit();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|