From a90736592a9f9c8f8d3a80c3ec590d084d163c49 Mon Sep 17 00:00:00 2001 From: yueyang <2495544247@qq.com> Date: Mon, 12 Oct 2026 17:11:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=9A=E7=BB=A9=E6=98=8E=E7=BB=86=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=EF=BC=9A=E8=AE=A2=E5=8D=95=E5=AE=9E=E4=BB=98=E5=91=BD?= =?UTF-8?q?=E4=B8=AD=E5=8D=B3=E7=AE=97=E8=AE=A2=E5=8D=95=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E8=A2=AB=E8=AF=AF=E5=88=A4=E3=80=8C=E8=AE=A2=E5=8D=95=E8=A1=A8?= =?UTF-8?q?=E6=97=A0=E6=AD=A4=E5=8D=95=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 部分订单(退款流程 / 拆单 / 商品明细未同步)在订单侧只有订单头与实付、没有商品明细行,原匹配逻辑仅按商品明细判断订单存在性导致误判。改为实付命中同样计入订单存在性;商品金额仍只由商品明细构建(无明细时保持为空)。实跑修复 8 月 1791 行(得物 57 / 京喜 497 / 抖音 46 / 京东 153 / 拼多多 1038)。 --- app/Console/Commands/SyncStoreReceiptOrderMatches.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Console/Commands/SyncStoreReceiptOrderMatches.php b/app/Console/Commands/SyncStoreReceiptOrderMatches.php index 944d5d0a..004f775f 100644 --- a/app/Console/Commands/SyncStoreReceiptOrderMatches.php +++ b/app/Console/Commands/SyncStoreReceiptOrderMatches.php @@ -606,6 +606,14 @@ class SyncStoreReceiptOrderMatches extends Command $shopKey = self::normalizeShop((string) ($row['shop_name'] ?? '')); $key = $shopKey . '|' . $core; $orderPaid[$key] = ($orderPaid[$key] ?? 0.0) + (float) $row['paid']; + // 订单实付命中同样算「订单侧存在」:部分订单(退款流程 / 拆单 / 商品明细未同步)没有商品明细行, + // 若只按商品明细判断存在性,这些单会被误判「订单表无此单」(实付明明在)。 + // 商品金额数组仍只由商品明细构建:无明细时商品金额保持为空、按口径标「订单无商品金额」。 + $orderSeen[$key] = true; + $coreSeen[$core] = true; + if ($shopKey !== '') { + $coresByCore[$core][$shopKey] = true; + } } foreach ($orderRows as $row) {