Appointment.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <?php
  2. namespace app\admin\controller\medical;
  3. use app\admin\controller\BaseController;
  4. use app\admin\model\MerchantShop;
  5. use app\admin\server\medical\AppointmentLogServer;
  6. use app\admin\server\medical\AppointmentServer;
  7. use app\admin\server\medical\MedicalCarePostageServer;
  8. use app\admin\server\medical\MedicalCareProductServer;
  9. use app\admin\server\medical\ShopServer;
  10. use app\admin\server\package\PackageGoodsServer;
  11. class Appointment extends BaseController
  12. {
  13. /**
  14. * Notes:预约服务列表
  15. * @return \support\Response
  16. * User: QJF
  17. * Date: 2022/9/30
  18. */
  19. public function getMentList()
  20. {
  21. [$page, $limit] = $this->getPage();
  22. $keywords = $this->request->get('keywords');
  23. $result = AppointmentServer::getMentList($page, $limit,$keywords);
  24. return json_success($result, '成功');
  25. }
  26. /**
  27. * Notes:添加预约服务
  28. * @return \support\Response
  29. * User: QJF
  30. * Date: 2022/9/28
  31. *
  32. */
  33. public function addMent()
  34. {
  35. $param = $this->request->post();
  36. $this->validateCheck('medical\MentValidate',
  37. [
  38. 'appointment_category_id' => $param['appointment_category_id'],
  39. 'appointment_shop_id' => $param['appointment_shop_id'],
  40. 'appointment_name' => $param['appointment_name'],
  41. 'appointment_price' => $param['appointment_price'],
  42. 'appointment_type' => $param['appointment_type'],
  43. 'appointment_hour_count' => $param['appointment_hour_count'],
  44. 'appointment_status' => $param['appointment_status'],
  45. 'appointment_service_instructions' => $param['appointment_service_instructions']
  46. ],
  47. 'add');
  48. $result = AppointmentServer::insertMent($param);
  49. return json_success($result, '添加成功');
  50. }
  51. /**
  52. * Notes:修改预约服务
  53. * @return \support\Response
  54. * User: QJF
  55. * Date: 2022/9/30
  56. */
  57. public function updateMent()
  58. {
  59. $param = $this->request->post();
  60. $this->validateCheck('medical\MentValidate',
  61. [
  62. 'appointment_id' => $param['appointment_id'],
  63. 'appointment_category_id' => $param['appointment_category_id'],
  64. 'appointment_shop_id' => $param['appointment_shop_id'],
  65. 'appointment_name' => $param['appointment_name'],
  66. 'appointment_price' => $param['appointment_price'],
  67. 'appointment_type' => $param['appointment_type'],
  68. 'appointment_hour_count' => $param['appointment_hour_count'],
  69. 'appointment_status' => $param['appointment_status'],
  70. 'appointment_service_instructions' => $param['appointment_service_instructions']
  71. ], 'update');
  72. $result = AppointmentServer::updateMent($param);
  73. return json_success($result, '修改成功');
  74. }
  75. /**
  76. * Notes:删除预约服务
  77. * @return \support\Response
  78. * User: QJF
  79. * Date: 2022/9/23
  80. */
  81. public function delMent()
  82. {
  83. $appointment_id = $this->request->get('appointment_id');
  84. $this->validateCheck('medical\MentValidate', ['appointment_id' => $appointment_id], 'del');
  85. $result = AppointmentServer::delMent($appointment_id);
  86. if ($result){
  87. return json_success($result, '删除成功');
  88. }else{
  89. throw new \Exception('删除失败!');
  90. }
  91. }
  92. /**
  93. * Notes:查看预约服务
  94. * @return \support\Response
  95. * User: QJF
  96. * Date: 2022/9/28
  97. */
  98. public function infoMent()
  99. {
  100. $appointment_id = $this->request->get('appointment_id');
  101. $this->validateCheck('medical\MentValidate', ['appointment_id' => $appointment_id], 'info');
  102. $result = AppointmentServer::infoMent($appointment_id);
  103. if ($result){
  104. return json_success($result, '获取成功');
  105. }else{
  106. throw new \Exception('获取失败!');
  107. }
  108. }
  109. //预约服务上下架
  110. public function showMent(){
  111. $appointment_id = $this->request->get('appointment_id');
  112. $appointment_status= $this->request->get('appointment_status');
  113. $result = AppointmentServer::showMent($appointment_id,$appointment_status);
  114. if ($result){
  115. return json_success($result, '成功');
  116. }else{
  117. throw new \Exception('失败!');
  118. }
  119. }
  120. /**
  121. * Notes:查看预约记录
  122. * @return \support\Response
  123. * User: QJF
  124. * Date: 2022/10/22
  125. */
  126. public function mentLogList()
  127. {
  128. [$page, $limit] = $this->getPage();
  129. $result = AppointmentLogServer::getMentLogList($page, $limit);
  130. return json_success($result, '成功');
  131. }
  132. /**
  133. * Notes:查看预约记录
  134. * @return \support\Response
  135. * User: QJF
  136. * Date: 2022/10/22
  137. */
  138. public function mentLogInfo()
  139. {
  140. $log_appointment_id = $this->request->get('log_id');
  141. $result = AppointmentLogServer::infoMentLog($log_appointment_id);
  142. if ($result){
  143. return json_success($result, '获取成功');
  144. }else{
  145. throw new \Exception('获取失败!');
  146. }
  147. }
  148. }