diff --git a/app/api/controller/Index.php b/app/api/controller/Index.php index 7ec7db6..ffe82c6 100644 --- a/app/api/controller/Index.php +++ b/app/api/controller/Index.php @@ -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() { diff --git a/config/log.php b/config/log.php index 3d6e791..d3d235a 100644 --- a/config/log.php +++ b/config/log.php @@ -62,6 +62,7 @@ return [ 'apply' => '申请', 'check' => '审核通过', 'refue' => '审核拒绝', + 'grant' => '授予', 'back' => '撤销', 'topay' => '打款', 'open' => '开具',