From bccffc76010659955f506e6719284cbef9f0576c Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Mon, 17 Apr 2023 15:00:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/CallBackController.php | 29 ++++++++++++++------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/app/Controller/CallBackController.php b/app/Controller/CallBackController.php index b3efda1..43fd25c 100644 --- a/app/Controller/CallBackController.php +++ b/app/Controller/CallBackController.php @@ -306,22 +306,23 @@ class CallBackController extends AbstractController // 发送推送消息 if ($inquiry_refund_status == 3) { try { - // 发送站内、订阅、短信消息-问诊服务退款成功 - $MessagePush = new MessagePush($order_inquiry['user_id'], $order_inquiry['order_inquiry_id']); + if (!empty($order_inquiry['coupon_amount_total']) && $order_inquiry['coupon_amount_total'] > 0) { + // 发送站内、订阅、短信消息-问诊服务退款成功 + $MessagePush = new MessagePush($order_inquiry['user_id'], $order_inquiry['order_inquiry_id']); - // 取消订单原因(1:医生未接诊 2:主动取消 3:无可分配医生 4:客服取消 5:支付超时) - if ($order_inquiry['cancel_reason'] == 1) { - $MessagePush->refundInquirySuccess(1); - } elseif ($order_inquiry['cancel_reason'] == 2) { - $MessagePush->refundInquirySuccess(3); - } elseif ($order_inquiry['cancel_reason'] == 3) { - $MessagePush->refundInquirySuccess(2); + // 取消订单原因(1:医生未接诊 2:主动取消 3:无可分配医生 4:客服取消 5:支付超时) + if ($order_inquiry['cancel_reason'] == 1) { + $MessagePush->refundInquirySuccess(1); + } elseif ($order_inquiry['cancel_reason'] == 2) { + $MessagePush->refundInquirySuccess(3); + } elseif ($order_inquiry['cancel_reason'] == 3) { + $MessagePush->refundInquirySuccess(2); + } + + // 发送站内消息-优惠卷退还 + $MessagePush = new MessagePush($order_inquiry['user_id'], $order_inquiry['order_inquiry_id']); + $MessagePush->patientRefundCoupon(); } - - // 发送站内消息-优惠卷退还 - $MessagePush = new MessagePush($order_inquiry['user_id'], $order_inquiry['order_inquiry_id']); - $MessagePush->patientRefundCoupon(); - } catch (\Exception $e) { // 验证失败 Log::getInstance()->error("微信退款回调处理成功,推送消息失败:" . $e->getMessage());