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;