1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?php
- declare (strict_types=1);
- namespace app\zskk\controller;
- use app\admin\model\dict\Commondata;
- use app\common\controller\ZskkApiController;
- use think\db\exception\DataNotFoundException;
- use think\db\exception\DbException;
- use think\db\exception\ModelNotFoundException;
- use Throwable;
- use app\zskk\servies\HrServies;
- class Hr extends ZskkApiController
- {
- // protected function initialize(): void
- // {
- // BlurUtils::setNotNeedBlur();
- // }
- /**
- * 后台初始化请求
- * @return void
- * @throws Throwable
- */
- public function getRecogViewDetail(HrServies $servies): void
- {
- $params = $this->request->post();
- $token = $params['TOKEN'] ?? '';
- // todo 容错处理
- $data = $servies->getRecogViewDetailByToken($token);
- // if(empty($data))
- // {
- // $this->error('token失效或已过期');
- // }
- $this->success('success', $data);
- }
- /**
- * 后台初始化请求
- * @return void
- * @throws Throwable
- */
- public function getRecogViewHrDetail(HrServies $servies): void
- {
- $params = $this->request->post();
- $token = $params['TOKEN'] ?? '';
- // todo 容错处理
- $data = $servies->getRecogViewDetailByToken($token,1);
- // if(empty($data))
- // {
- // $this->error('token失效或已过期');
- // }
- $this->success('success', $data);
- }
- /**
- * @throws ModelNotFoundException
- * @throws DataNotFoundException
- * @throws DbException
- */
- public function saveRecogViewDetail(HrServies $servies): void
- {
- $params = $this->request->post();
- $HR_RECORDS = $params['HR_RECORDS'] ?? array();
- $TOKEN = $params['TOKEN'] ?? '';
- $servies->saveRecogViewDetail($HR_RECORDS, $TOKEN);
- $this->success('success');
- }
- public function getNoHrReasonList(): void
- {
- $model = new Commondata();
- $res = $model
- ->field(['code','name'])
- ->where('type', '7')
- ->where('status', 1)
- ->order('weigh asc, id asc')
- ->select()
- ->toArray();
- $this->success('', ['list' => $res]);
- }
- }
|