From e1893f64a3f109e6d46164d37cc6046534f6b11a Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Thu, 6 Apr 2023 09:44:39 +0800 Subject: [PATCH] 1 --- ...ncelUnInquiryOrdersDelayDirectConsumer.php | 3 --- app/Controller/CallBackController.php | 22 ++++++++++++++++++- app/Services/InquiryService.php | 2 ++ app/Services/PatientOrderService.php | 2 +- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/app/Amqp/Consumer/CancelUnInquiryOrdersDelayDirectConsumer.php b/app/Amqp/Consumer/CancelUnInquiryOrdersDelayDirectConsumer.php index b77afa5..677133e 100644 --- a/app/Amqp/Consumer/CancelUnInquiryOrdersDelayDirectConsumer.php +++ b/app/Amqp/Consumer/CancelUnInquiryOrdersDelayDirectConsumer.php @@ -171,9 +171,6 @@ class CancelUnInquiryOrdersDelayDirectConsumer extends ConsumerMessage $MessagePush = new MessagePush($order_inquiry['user_id'],$order_inquiry['order_inquiry_id']); $MessagePush->patientNoInquiry(); - // 发送站内、订阅、短信消息-问诊服务退款成功 - $MessagePush->refundInquirySuccess(); - Log::getInstance()->info("取消未接诊问诊订单成功,发送消息成功"); } catch (\Exception $e) { // 验证失败 diff --git a/app/Controller/CallBackController.php b/app/Controller/CallBackController.php index 71111c9..295add4 100644 --- a/app/Controller/CallBackController.php +++ b/app/Controller/CallBackController.php @@ -21,6 +21,7 @@ use App\Model\UserDoctor; use App\Model\UserPatient; use App\Services\BaseService; use App\Services\ImService; +use App\Services\MessagePush; use App\Utils\Log; use Extend\TencentIm\Account; use Extend\TencentIm\Message; @@ -283,10 +284,29 @@ class CallBackController extends AbstractController return $this->wxPayErrorReturn($e->getMessage()); } - Log::getInstance()->info("微信退款回调处理成功"); + Log::getInstance()->info("微信退款回调处理成功,推送消息"); // 发送短信消息 + try { + $MessagePush = new MessagePush($order_inquiry['user_id'],$order_inquiry['order_inquiry_id']); + // 取消订单原因(1:医生未接诊 2:主动取消 3:无可分配医生 4:客服取消 5:支付超时) + if ($order_inquiry['cancel_reason'] == 1){ + + } elseif ($order_inquiry['cancel_reason'] == 2){ + + } elseif ($order_inquiry['cancel_reason'] == 3){ + + } elseif ($order_inquiry['cancel_reason'] == 4){ + + } elseif ($order_inquiry['cancel_reason'] == 5){ + + } + }catch (\Exception $e) { + // 验证失败 + Log::getInstance()->error("微信退款回调处理成功,推送消息失败:" . $e->getMessage()); + return $server->serve(); + } return $server->serve(); } diff --git a/app/Services/InquiryService.php b/app/Services/InquiryService.php index 9268865..d6537ef 100644 --- a/app/Services/InquiryService.php +++ b/app/Services/InquiryService.php @@ -881,6 +881,8 @@ class InquiryService extends BaseService * @param string|int $cancel_reason 取消订单原因(1:医生未接诊 2:主动取消 3:无可分配医生 4:客服取消 5:支付超时) * @param string|int $cancel_remarks 取消订单备注 * @return array + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function cancelUnpayInquiryOrder(string|int $order_no, string|int $cancel_reason, string|int $cancel_remarks): array { diff --git a/app/Services/PatientOrderService.php b/app/Services/PatientOrderService.php index 5ae2eda..fedec4a 100644 --- a/app/Services/PatientOrderService.php +++ b/app/Services/PatientOrderService.php @@ -812,7 +812,7 @@ class PatientOrderService extends BaseService // 发送IM消息-等待医生接诊 $imService = new ImService(); - $imService->waitDoctorInquiry($order_inquiry,$user_info['user_id'],$order_inquiry['user_id']); + $imService->waitDoctorInquiry($order_inquiry,$user_doctor['user_id'],$order_inquiry['user_id']); }