From f93f88fa26c43951175071aec20be9e0959da004 Mon Sep 17 00:00:00 2001 From: wikiboss Date: Sun, 1 Nov 2026 12:45:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(pay):=20=E9=A2=84=E4=BB=98=E6=AC=BE?= =?UTF-8?q?=E7=BB=84=E5=90=88=E6=94=AF=E4=BB=98=E7=99=BB=E5=BD=95=E6=8B=A6?= =?UTF-8?q?=E6=88=AA=E4=B8=8E=E5=9B=9E=E8=B0=83=E5=A4=8D=E6=9F=A5=E5=B9=B2?= =?UTF-8?q?=E5=87=80=E5=AE=9E=E4=BE=8B=E9=87=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/shopro/controller/Pay.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/shopro/controller/Pay.php b/addons/shopro/controller/Pay.php index 2d331f7..2c4fa48 100644 --- a/addons/shopro/controller/Pay.php +++ b/addons/shopro/controller/Pay.php @@ -107,6 +107,9 @@ class Pay extends Base if (strpos($order_sn, 'TO') !== 0) { // 保持 order_sn 不变,避免支付回调时找不到订单 if ($payment == 'group') { + if (!$user) { + $this->error('请先登录', null, 401); + } $payment = 'wechat'; // 重新计算价格 $order_data['total_fee'] = bcsub($order_data['total_fee'], $user->money, 2); @@ -377,8 +380,9 @@ class Pay extends Base }); if ($isProcessed) { - // 已经被并发处理过,直接向网关确认成功 - $paidOrder = $order->where('order_sn', $out_trade_no)->where('status', '>', 0)->find(); + // 已经被并发处理过,直接向网关确认成功(使用全新实例避免前置查询条件残留) + list($paidCheckOrder) = $this->getOrderInstance($out_trade_no); + $paidOrder = $paidCheckOrder->where('order_sn', $out_trade_no)->where('status', '>', 0)->find(); if ($paidOrder) { return $pay->success()->send(); }