From 9e2ae344c801e9225fca85498b27ce153ed6dc1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=98=8A=E5=A4=A9?= <442384644@qq.com> Date: Mon, 28 Sep 2026 16:02:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=20OrderPaidListener?= =?UTF-8?q?=20=E4=B8=AD=E7=9A=84=E8=AE=A2=E5=8D=95=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A1=AE=E4=BF=9D=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=95=B0=E7=BB=84=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/product/virtual/listener/OrderPaidListener.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/modules/product/virtual/listener/OrderPaidListener.php b/backend/modules/product/virtual/listener/OrderPaidListener.php index c81f888e2..4bc6ca340 100644 --- a/backend/modules/product/virtual/listener/OrderPaidListener.php +++ b/backend/modules/product/virtual/listener/OrderPaidListener.php @@ -51,8 +51,9 @@ class OrderPaidListener return; } - // 加载中台订单(含商品快照),供履约与销量累加使用 + // 加载中台订单(含商品快照),供履约与销量累加使用;get() 返回模型,统一转数组 $center = $centerDao->get(['order_no' => $orderNo], ['uid', 'extra_info']); + $center = $center ? $center->toArray() : []; // 中台表已经标记为已支付时,避免重复写入 pay_time $isCenterPaid = (int)($meta['pay_status'] ?? 0) === 1; @@ -80,7 +81,7 @@ class OrderPaidListener $handler->afterPay($orderNo, $cartInfoList); // 4. 累加商品销量(中台主表冗余字段;位于幂等闸与事务内,不会重复累计) - $this->incProductSales(is_array($center) ? $center : []); + $this->incProductSales($center); }); }