修改问诊退款回调,只有退款成功,才会推送消息
This commit is contained in:
parent
e613684842
commit
45fc94bcee
@ -284,10 +284,12 @@ class CallBackController extends AbstractController
|
|||||||
OrderInquiryRefund::edit($params,$data);
|
OrderInquiryRefund::edit($params,$data);
|
||||||
|
|
||||||
// 恢复优惠卷
|
// 恢复优惠卷
|
||||||
|
if ($inquiry_refund_status == 3){
|
||||||
if (!empty($order_inquiry['coupon_amount_total']) && $order_inquiry['coupon_amount_total'] > 0) {
|
if (!empty($order_inquiry['coupon_amount_total']) && $order_inquiry['coupon_amount_total'] > 0) {
|
||||||
$InquiryService = new InquiryService();
|
$InquiryService = new InquiryService();
|
||||||
$InquiryService->returnInquiryCoupon($order_inquiry['order_inquiry_id'],$order_inquiry['user_id']);
|
$InquiryService->returnInquiryCoupon($order_inquiry['order_inquiry_id'],$order_inquiry['user_id']);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Db::commit();
|
Db::commit();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@ -300,6 +302,7 @@ class CallBackController extends AbstractController
|
|||||||
Log::getInstance()->info("微信退款回调处理成功,推送消息");
|
Log::getInstance()->info("微信退款回调处理成功,推送消息");
|
||||||
|
|
||||||
// 发送推送消息
|
// 发送推送消息
|
||||||
|
if ($inquiry_refund_status == 3){
|
||||||
try {
|
try {
|
||||||
// 发送站内、订阅、短信消息-问诊服务退款成功
|
// 发送站内、订阅、短信消息-问诊服务退款成功
|
||||||
$MessagePush = new MessagePush($order_inquiry['user_id'],$order_inquiry['order_inquiry_id']);
|
$MessagePush = new MessagePush($order_inquiry['user_id'],$order_inquiry['order_inquiry_id']);
|
||||||
@ -312,11 +315,18 @@ class CallBackController extends AbstractController
|
|||||||
} elseif ($order_inquiry['cancel_reason'] == 3){
|
} elseif ($order_inquiry['cancel_reason'] == 3){
|
||||||
$MessagePush->refundInquirySuccess(2);
|
$MessagePush->refundInquirySuccess(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 发送站内消息-优惠卷退还
|
||||||
|
$MessagePush = new MessagePush($order_inquiry['user_id'],$order_inquiry['order_inquiry_id']);
|
||||||
|
$MessagePush->patientRefundCoupon();
|
||||||
|
|
||||||
}catch (\Exception $e) {
|
}catch (\Exception $e) {
|
||||||
// 验证失败
|
// 验证失败
|
||||||
Log::getInstance()->error("微信退款回调处理成功,推送消息失败:" . $e->getMessage());
|
Log::getInstance()->error("微信退款回调处理成功,推送消息失败:" . $e->getMessage());
|
||||||
return $server->serve();
|
return $server->serve();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $server->serve();
|
return $server->serve();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1210,9 +1210,6 @@ class InquiryService extends BaseService
|
|||||||
$params['user_coupon_id'] = $order_inquiry_coupon['user_coupon_id'];
|
$params['user_coupon_id'] = $order_inquiry_coupon['user_coupon_id'];
|
||||||
UserCoupon::edit($params, $data);
|
UserCoupon::edit($params, $data);
|
||||||
|
|
||||||
// 发送站内消息-优惠卷退还
|
|
||||||
$MessagePush = new MessagePush($patient_user_id,$order_inquiry_id);
|
|
||||||
$MessagePush->patientRefundCoupon();
|
|
||||||
return true;
|
return true;
|
||||||
} catch(\Exception $e){
|
} catch(\Exception $e){
|
||||||
Log::getInstance()->error("退还用户优惠卷失败" . $e->getMessage());
|
Log::getInstance()->error("退还用户优惠卷失败" . $e->getMessage());
|
||||||
|
|||||||
@ -40,12 +40,12 @@ class Kuaidi
|
|||||||
* @return mixed
|
* @return mixed
|
||||||
* @throws GuzzleException
|
* @throws GuzzleException
|
||||||
*/
|
*/
|
||||||
protected function httpRequest(string $path, array $arg = []): mixed
|
protected function httpRequest(string $path, string $arg = []): mixed
|
||||||
{
|
{
|
||||||
$option = [
|
$option = [
|
||||||
"headers" => [
|
"json" => [
|
||||||
"sign" => config("ca.app_id"),
|
"schema" => "json",
|
||||||
"signature" => $this->getRequestSign($arg),
|
"param" => json_encode($params, JSON_UNESCAPED_UNICODE),
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -75,8 +75,16 @@ class Kuaidi
|
|||||||
return $body['body'];
|
return $body['body'];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getSign(string $data){
|
/**
|
||||||
$sign = md5($data . config("kuaidi100.key") . config("kuaidi100.customer"));
|
* 获取签名
|
||||||
|
* @param string $params
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected function getSign(string $params): string
|
||||||
|
{
|
||||||
|
return md5($params . config("kuaidi100.key") . config("kuaidi100.customer"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user