Doctor.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <?php
  2. namespace app\admin\controller\medical;
  3. use app\admin\controller\BaseController;
  4. use app\admin\server\medical\DoctorServer;
  5. class Doctor extends BaseController
  6. {
  7. /**
  8. * Notes:医生列表
  9. * @return \support\Response
  10. * User: yym
  11. * Date: 2022/9/26
  12. */
  13. public function getDoctorList()
  14. {
  15. [$page, $limit] = $this->getPage();
  16. $keywords = $this->request->get('keywords');
  17. $result = DoctorServer::getDoctorList($page, $limit,$keywords);
  18. return json_success($result, '成功');
  19. }
  20. /**
  21. * Notes:添加医生
  22. * @return \support\Response
  23. * @throws \Exception
  24. * User: yym
  25. * Date: 2022/9/26
  26. */
  27. public function addDoctor()
  28. {
  29. $param = $this->request->post();
  30. $this->validateCheck('medical\DoctorValidate',
  31. [
  32. 'doctor_name' => $param['doctor_name'] ?? '',//医生姓名
  33. 'doctor_position' => $param['doctor_position'] ?? '',//医生职位
  34. 'doctor_head' => $param['doctor_head'] ?? '',//医生头像
  35. 'doctor_mobile' => $param['doctor_mobile'] ?? '',//医生手机号
  36. 'doctor_info' => $param['doctor_info'] ?? '',//医生擅长技能
  37. 'doctor_visit' => $param['doctor_visit'] ?? '',//是否支持出诊 0否 1是
  38. 'doctor_visit_time' => $param['doctor_visit_time'] ?? '',//出诊时间
  39. 'doctor_work' => $param['doctor_work'] ?? '',//上班时间 一,三,五
  40. 'doctor_money' => $param['doctor_money'] ?? '',//收费标准
  41. 'doctor_type' => $param['doctor_type'] ?? '',//医生类型 0医院 1健康管理师 2家庭医生
  42. 'doctor_on_line' => $param['doctor_on_line'] ?? '',//是否支持线上沟通 0否 1是
  43. 'doctor_shop_id' => $param['doctor_shop_id'] ?? '',//医疗店铺ID
  44. 'doctor_subject_id' => $param['doctor_subject_id'] ?? '',//科目编号
  45. 'doctor_address' => $param['doctor_address'] ?? '',//科室地点
  46. 'doctor_status' => $param['doctor_status'] ?? '',//医生状态 0休班 1在班
  47. ],
  48. 'add');
  49. $admin_id = $this->request->admin_id;
  50. $result = DoctorServer::insertDoctor($param, $admin_id);
  51. return json_success($result, '添加成功');
  52. }
  53. /**
  54. * Notes:医生编辑
  55. * @return \support\Response
  56. * @throws \Exception
  57. * User: yym
  58. * Date: 2022/9/26
  59. */
  60. public function updateDoctor()
  61. {
  62. $param = $this->request->post();
  63. $this->validateCheck('medical\DoctorValidate',
  64. [
  65. 'doctor_id' => $param['doctor_id'] ?? '',//医生编号
  66. 'doctor_name' => $param['doctor_name'] ?? '',//医生姓名
  67. 'doctor_position' => $param['doctor_position'] ?? '',//医生职位
  68. 'doctor_head' => $param['doctor_head'] ?? '',//医生头像
  69. 'doctor_mobile' => $param['doctor_mobile'] ?? '',//医生手机号
  70. 'doctor_info' => $param['doctor_info'] ?? '',//医生擅长技能
  71. 'doctor_visit' => $param['doctor_visit'] ?? '',//是否支持出诊 0否 1是
  72. 'doctor_visit_time' => $param['doctor_visit_time'] ?? '',//出诊时间
  73. 'doctor_work' => $param['doctor_work'] ?? '',//上班时间 一,三,五
  74. 'doctor_money' => $param['doctor_money'] ?? '',//收费标准
  75. 'doctor_type' => $param['doctor_type'] ?? '',//医生类型 0医院 1健康管理师 2家庭医生
  76. 'doctor_on_line' => $param['doctor_on_line'] ?? '',//是否支持线上沟通 0否 1是
  77. 'doctor_shop_id' => $param['doctor_shop_id'] ?? '',//医疗店铺ID
  78. 'doctor_subject_id' => $param['doctor_subject_id'] ?? '',//科目编号
  79. 'doctor_address' => $param['doctor_address'] ?? '',//科室地点
  80. 'doctor_status' => $param['doctor_status'] ?? '',//医生状态 0休班 1在班
  81. ],
  82. 'update');
  83. $admin_id = $this->request->admin_id;
  84. $result = DoctorServer::updateDoctor($param, $admin_id);
  85. return json_success($result, '修改成功');
  86. }
  87. /**
  88. * Notes:删除医生
  89. * @return \support\Response
  90. * User: yym
  91. * Date: 2022/9/19
  92. */
  93. public function deleteDoctor()
  94. {
  95. $doctor_id = $this->request->post('doctor_id');
  96. $this->validateCheck('medical\DoctorValidate', ['doctor_id' => $doctor_id], 'del');
  97. $admin_id = $this->request->admin_id;
  98. DoctorServer::deleteDoctor($doctor_id, $admin_id);
  99. return json_success([], '删除成功');
  100. }
  101. /**
  102. * Notes:获取医生详情
  103. * @return \support\Response
  104. * @throws \Exception
  105. * User: yym
  106. * Date: 2022/9/26
  107. */
  108. public function getDoctorInfo()
  109. {
  110. $doctor_id = $this->request->get('doctor_id');
  111. $this->validateCheck('medical\DoctorValidate', ['doctor_id' => $doctor_id], 'info');
  112. $result = DoctorServer::getDoctorInfo($doctor_id);
  113. return json_success($result, '获取成功');
  114. }
  115. /**
  116. * Notes:医生每日工作接纳人数设置----目前按照每半小时时间段设置
  117. * @return \support\Response
  118. * @throws \Exception
  119. * User: yym
  120. * Date: 2022/9/27
  121. */
  122. public function setAppointment()
  123. {
  124. $doctor_id = (int)$this->request->post('doctor_id');//医生编号
  125. $work_time = $this->request->post('work_time');//工作时间 一代表周一 二代表周二
  126. $appointment_sum = (int)$this->request->post('appointment_sum');//每半小时预约人数
  127. $morning_start = $this->request->post('morning_start', '');//上午开始时间
  128. $morning_end = $this->request->post('morning_end', '');//上午结束时间
  129. $afternoon_start = $this->request->post('afternoon_start', '');//下午开始时间
  130. $afternoon_end = $this->request->post('afternoon_end', '');//下午结束时间
  131. $this->validateCheck('medical\DoctorValidate',
  132. [
  133. 'doctor_id' => $doctor_id,
  134. 'work_time' => $work_time,
  135. 'appointment_sum' => $appointment_sum,
  136. // 'morning_start' => $morning_start,
  137. // 'morning_end' => $morning_end,
  138. // 'afternoon_start' => $afternoon_start,
  139. // 'afternoon_end' => $afternoon_end
  140. ],
  141. 'set');
  142. $admin_id = $this->request->admin_id;
  143. DoctorServer::setAppointment($doctor_id, $admin_id, $work_time, $morning_start, $morning_end, $afternoon_start, $afternoon_end, $appointment_sum);
  144. return json_success([], '设置成功');
  145. }
  146. /**
  147. * Notes:获取设置详情
  148. * @return \support\Response
  149. * User: yym
  150. * Date: 2022/10/13
  151. */
  152. public function getAppointment()
  153. {
  154. $doctor_id = $this->request->get('doctor_id');//医生列表
  155. $this->validateCheck('medical\DoctorValidate',
  156. [
  157. 'doctor_id' => $doctor_id
  158. ],
  159. 'info');
  160. return json_success(DoctorServer::getAppointment($doctor_id));
  161. }
  162. }