diff --git a/app/Controller/InquiryController.php b/app/Controller/InquiryController.php index f9cf9d1..4f8b52e 100644 --- a/app/Controller/InquiryController.php +++ b/app/Controller/InquiryController.php @@ -179,4 +179,15 @@ class InquiryController extends AbstractController $data = $InquiryService->addVideoReservationDate(); return $this->response->json($data); } + + /** + * 获取视频问诊消息内页基础数据 + * @return ResponseInterface + */ + public function getInquiryVideoMessageBasic(): ResponseInterface + { + $InquiryService = new InquiryService(); + $data = $InquiryService->addVideoReservationDate(); + return $this->response->json($data); + } } \ No newline at end of file diff --git a/app/Services/InquiryService.php b/app/Services/InquiryService.php index a0cfddf..6dd4afd 100644 --- a/app/Services/InquiryService.php +++ b/app/Services/InquiryService.php @@ -1369,6 +1369,8 @@ class InquiryService extends BaseService } // 获取是否已经预约 + $is_reservation = false; + $params = array(); $params['order_inquiry_id'] = $order_inquiry_id; $order_inquiry_video = OrderInquiryVideo::getOne($params); @@ -1382,6 +1384,8 @@ class InquiryService extends BaseService if ($order_inquiry_video['update_number'] >= 1){ return fail(HttpEnumCode::HTTP_ERROR, "已无法设置/修改视频时间,可立即发起视频"); } + + $is_reservation = true; } // 创建订单 @@ -1435,7 +1439,11 @@ class InquiryService extends BaseService // 发送im消息 $imService = new ImService(); - + if ($is_reservation){ + // 修改 + }else{ + // 新增 + } // 发送短信-患者-视频预约成功 diff --git a/config/routes.php b/config/routes.php index 58305a5..0dd26ab 100644 --- a/config/routes.php +++ b/config/routes.php @@ -832,7 +832,7 @@ Router::addGroup('/im', function () { Router::get('/{order_inquiry_id:\d+}', [InquiryController::class, 'getInquiryMessageBasic']); // 获取视频问诊消息内页基础数据 - Router::get('/video/{order_inquiry_id:\d+}', [InquiryController::class, 'getInquiryMessageBasic']); + Router::get('/video/{order_inquiry_id:\d+}', [InquiryController::class, 'getInquiryVideoMessageBasic']); }); }); });