新增获取员工API接口

This commit is contained in:
hdm 2023-01-04 15:45:44 +08:00
parent 3b705d183c
commit 9b2a96e03d
2 changed files with 24 additions and 0 deletions

View File

@ -196,6 +196,29 @@ class Index extends BaseController
return to_assign(0, '', $employee);
}
//获取所有员工
public function get_personnel()
{
$param = get_params();
$where[] = ['a.status', '=', 1];
$where[] = ['a.id', '>', 1];
if (!empty($param['keywords'])) {
$where[] = ['a.name', 'like', '%' . $param['keywords'] . '%'];
}
if(!empty($param['ids'])){
$where[] = ['a.id', 'notin', $param['ids']];
}
$rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit'];
$list = Db::name('admin')
->field('a.id,a.did,a.position_id,a.mobile,a.name,a.nickname,a.sex,a.status,a.thumb,a.username,d.title as department')
->alias('a')
->join('Department d', 'a.did = d.id')
->where($where)
->order('a.id desc')
->paginate($rows, false, ['query' => $param]);
return table_assign(0, '', $list);
}
//获取部门所有员工
public function get_employee_select()
{

View File

@ -62,6 +62,7 @@ return [
'apply' => '申请',
'check' => '审核通过',
'refue' => '审核拒绝',
'grant' => '授予',
'back' => '撤销',
'topay' => '打款',
'open' => '开具',