From 8ff21f94d27f4b99de4e30abcc795c0fe139bd02 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 16 May 2024 11:27:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/order/RetailOrderController.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/api/controller/order/RetailOrderController.php b/app/api/controller/order/RetailOrderController.php index e8fb16f..97fc5e5 100644 --- a/app/api/controller/order/RetailOrderController.php +++ b/app/api/controller/order/RetailOrderController.php @@ -19,6 +19,7 @@ use app\common\model\user\User; use app\common\model\user\UserAddress; use app\common\service\wechat\WeChatConfigService; use support\Log; +use Webman\RedisQueue\Redis; class RetailOrderController extends BaseApiController { @@ -156,8 +157,11 @@ class RetailOrderController extends BaseApiController if (PaymentLogic::hasError()) { return $this->fail(PaymentLogic::getError(), $params); } - if($result['trade_state_desc']=='支付成功'){ + if(isset($result['trade_state_desc']) && $result['trade_state_desc']=='支付成功'){ PayNotifyLogic::handle('cashierclass', $result['out_trade_no'], $result); + }else{ + Redis::send('send-code-pay', ['number'=>$order['number']]); + return $this->success('用户支付中'); } return $this->success('', $result); break; @@ -228,8 +232,11 @@ class RetailOrderController extends BaseApiController if (PaymentLogic::hasError()) { return $this->fail(PaymentLogic::getError(), $params); } - if($result['trade_state_desc']=='支付成功'){ + if(isset($result['trade_state_desc']) && $result['trade_state_desc']=='支付成功'){ PayNotifyLogic::handle('cashierclass', $result['out_trade_no'], $result); + }else{ + Redis::send('send-code-pay', ['number'=>$order['number']]); + return $this->success('用户支付中'); } return $this->success('支付成功',['order_id'=>$order['order_id']]); break;