修改问诊退款回调,只有退款成功,才会推送消息
This commit is contained in:
@@ -284,9 +284,11 @@ class CallBackController extends AbstractController
|
||||
OrderInquiryRefund::edit($params,$data);
|
||||
|
||||
// 恢复优惠卷
|
||||
if (!empty($order_inquiry['coupon_amount_total']) && $order_inquiry['coupon_amount_total'] > 0) {
|
||||
$InquiryService = new InquiryService();
|
||||
$InquiryService->returnInquiryCoupon($order_inquiry['order_inquiry_id'],$order_inquiry['user_id']);
|
||||
if ($inquiry_refund_status == 3){
|
||||
if (!empty($order_inquiry['coupon_amount_total']) && $order_inquiry['coupon_amount_total'] > 0) {
|
||||
$InquiryService = new InquiryService();
|
||||
$InquiryService->returnInquiryCoupon($order_inquiry['order_inquiry_id'],$order_inquiry['user_id']);
|
||||
}
|
||||
}
|
||||
|
||||
Db::commit();
|
||||
@@ -300,23 +302,31 @@ class CallBackController extends AbstractController
|
||||
Log::getInstance()->info("微信退款回调处理成功,推送消息");
|
||||
|
||||
// 发送推送消息
|
||||
try {
|
||||
// 发送站内、订阅、短信消息-问诊服务退款成功
|
||||
$MessagePush = new MessagePush($order_inquiry['user_id'],$order_inquiry['order_inquiry_id']);
|
||||
if ($inquiry_refund_status == 3){
|
||||
try {
|
||||
// 发送站内、订阅、短信消息-问诊服务退款成功
|
||||
$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();
|
||||
|
||||
}catch (\Exception $e) {
|
||||
// 验证失败
|
||||
Log::getInstance()->error("微信退款回调处理成功,推送消息失败:" . $e->getMessage());
|
||||
return $server->serve();
|
||||
}
|
||||
}catch (\Exception $e) {
|
||||
// 验证失败
|
||||
Log::getInstance()->error("微信退款回调处理成功,推送消息失败:" . $e->getMessage());
|
||||
return $server->serve();
|
||||
}
|
||||
|
||||
return $server->serve();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user