ExamDao.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <?php
  2. namespace app\api\dao\exam;
  3. use app\api\actions\ZskkCache;
  4. use app\api\dao\ZskkDefaultDao;
  5. use app\api\model\exam\ExamModel;
  6. use think\facade\Log;
  7. /**
  8. * 后台控制器基类
  9. * 接口方法权限 必传参数 接口返回 错误抛出 通用参数处理
  10. */
  11. class ExamDao extends ZskkDefaultDao {
  12. protected $flag = true;
  13. protected $logName = "ExamDao";
  14. protected $exam = null;
  15. public function __construct(ExamModel $examModel)
  16. {
  17. parent::__construct();
  18. $this->exam = $examModel;
  19. }
  20. public function getExamClass($class)
  21. {
  22. $where = [];
  23. if($class == '*')
  24. {
  25. return $where;
  26. }else{
  27. $where[] = ['exam_class','in',explode(',',$class)];
  28. return $where;
  29. }
  30. }
  31. public function getDoctorDepart($id)
  32. {
  33. $depart = $this->exam->getDoctorDepart($id);
  34. return $depart;
  35. }
  36. public function getInsInfo($id)
  37. {
  38. $info = $this->exam->geInsInfo($id);
  39. return $info;
  40. }
  41. public function getRemoteExamClass($class)
  42. {
  43. $where = [];
  44. if($class == '*')
  45. {
  46. return $where;
  47. }else{
  48. $where[] = ['a.exam_class','in',explode(',',$class)];
  49. return $where;
  50. }
  51. }
  52. public function getInstitution($token)
  53. {
  54. $institution = $this->getCache($token)['institution_id'] ?? false;
  55. if(!$institution){
  56. $this->throwError('登陆信息失效,请重新进行登陆','0099');
  57. }
  58. return $institution;
  59. }
  60. public function checkIsSet($studyId)
  61. {
  62. $id = $this->exam->check($studyId);
  63. return $id;
  64. }
  65. public function getExamList($institutionId, $fuzzyWhere, $moreWhere,$class_where, $params,$report_where,$gradeWhere)
  66. {
  67. $info = $this->exam->getExamList($institutionId, $fuzzyWhere, $moreWhere,$class_where, $params,$report_where,$gradeWhere);
  68. return $info;
  69. }
  70. public function getRemoteExamList($institutionId, $fuzzyWhere, $moreWhere,$class_where, $params,$report_where)
  71. {
  72. $info = $this->exam->getRemoteExamList($institutionId, $fuzzyWhere, $moreWhere,$class_where, $params,$report_where);
  73. return $info;
  74. }
  75. public function getRemoteList($id,$institutionId)
  76. {
  77. $info = $this->exam->getRemoteList($id,$institutionId);
  78. return $info;
  79. }
  80. public function updateExam($id,$update)
  81. {
  82. $info = $this->exam->updateExam($update,$id);
  83. return $info;
  84. }
  85. public function insertExam($data)
  86. {
  87. $info = $this->exam->insertExam($data);
  88. return $info;
  89. }
  90. public function getReport($where,$institution)
  91. {
  92. $info = $this->exam->getReport($where,$institution);
  93. return $info;
  94. }
  95. public function getDoctorClass($doctor)
  96. {
  97. $class = $this->exam->getDoctorClass($doctor);
  98. return $class;
  99. }
  100. public function changeDoctor($doctor,$id)
  101. {
  102. $info = $this->exam->changeDoctor($doctor,$id);
  103. return $info;
  104. }
  105. public function getFilmAnnex($id,$exam_datetime,$code)
  106. {
  107. $info = $this->exam->getFilmAnnex($id,$exam_datetime,$code);
  108. return $info;
  109. }
  110. public function del_exam($id)
  111. {
  112. $info = $this->exam->del_exam($id);
  113. return $info;
  114. }
  115. public function insertDcmDel($data)
  116. {
  117. $info = $this->exam->insertDcmDel($data);
  118. return $info;
  119. }
  120. public function getSyncAi($where)
  121. {
  122. return $this->exam->getSyncAi($where);
  123. }
  124. public function getAiNode($where)
  125. {
  126. return $this->exam->getAiNode($where);
  127. }
  128. }