12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\hander\HelpHander;
- use think\Db;
- class Job extends Base
- {
- // 新增
- public function save(){
- model('Job')->add();
- HelpHander::success([],'操作成功');
- }
- // 编辑
- public function update(){
- model('Job')->add();
- HelpHander::success([],'操作成功');
- }
- // 详情
- public function detail(){
- $id = input('id/d',0);
- $ret = model('Job')->info($id);
- HelpHander::success($ret);
- }
- // 列表
- public function list(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $ret = model('Job')->lists($page,$size);
- HelpHander::success($ret);
- }
- // 修改状态
- public function changeStatus(){
- $id = input('id/d',0);
- $enable = input('enable/d',0);
- model('Job')->changeStatus($id,$enable);
- HelpHander::success([],'操作成功');
- }
- // 部门下的岗位
- public function queryJobByDep(){
- $depId = input('depId/d',0);
- $ret = model('Job')->queryJobByDep($depId);
- HelpHander::success($ret);
- }
- // 组织下的岗位
- public function queryJobByOrg(){
- $ret = model('Job')->queryJobByOrg($this->orgId);
- HelpHander::success($ret);
- }
- //查询当前岗位下未分配的人员
- public function screenUserByJob(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $jobId = input('jobId/d',1);
- $param = input('param','','trim'); // 姓名/工号
- $ret = model('Job')->screenUserByJob($page,$size,$jobId,$param);
- HelpHander::success($ret);
- }
- //查询当前岗位分配的人员
- public function queryUserByJob(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $jobId = input('jobId/d',1);
- $param = input('param','','trim'); // 姓名/工号
- $ret = model('Job')->queryUserByJob($page,$size,$jobId,$param);
- HelpHander::success($ret);
- }
- }
|