Hr.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. declare (strict_types=1);
  3. namespace app\zskk\controller;
  4. use app\admin\model\dict\Commondata;
  5. use app\common\controller\ZskkApiController;
  6. use think\db\exception\DataNotFoundException;
  7. use think\db\exception\DbException;
  8. use think\db\exception\ModelNotFoundException;
  9. use Throwable;
  10. use app\zskk\servies\HrServies;
  11. class Hr extends ZskkApiController
  12. {
  13. // protected function initialize(): void
  14. // {
  15. // BlurUtils::setNotNeedBlur();
  16. // }
  17. /**
  18. * 后台初始化请求
  19. * @return void
  20. * @throws Throwable
  21. */
  22. public function getRecogViewDetail(HrServies $servies): void
  23. {
  24. $params = $this->request->post();
  25. $token = $params['TOKEN'] ?? '';
  26. // todo 容错处理
  27. $data = $servies->getRecogViewDetailByToken($token);
  28. // if(empty($data))
  29. // {
  30. // $this->error('token失效或已过期');
  31. // }
  32. $this->success('success', $data);
  33. }
  34. /**
  35. * @throws ModelNotFoundException
  36. * @throws DataNotFoundException
  37. * @throws DbException
  38. */
  39. public function saveRecogViewDetail(HrServies $servies): void
  40. {
  41. $params = $this->request->post();
  42. $HR_RECORDS = $params['HR_RECORDS'] ?? array();
  43. $TOKEN = $params['TOKEN'] ?? '';
  44. $servies->saveRecogViewDetail($HR_RECORDS, $TOKEN);
  45. $this->success('success');
  46. }
  47. public function getNoHrReasonList(): void
  48. {
  49. $model = new Commondata();
  50. $res = $model
  51. ->field(['code','name'])
  52. ->where('type', '7')
  53. ->where('status', 1)
  54. ->order('weigh asc, id asc')
  55. ->select()
  56. ->toArray();
  57. $this->success('', ['list' => $res]);
  58. }
  59. }