From 22133450a6ef4b168424e51ba8bac1ef208edf6f Mon Sep 17 00:00:00 2001 From: qiuxiang <394405259@qq.com> Date: Sat, 10 Oct 2026 17:20:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=9A=E7=BB=A9=E6=98=8E=E7=BB=86=EF=BC=9A?= =?UTF-8?q?=E7=A7=8D=E8=8F=9C=E9=87=91=E9=A2=9D=E5=8F=A3=E5=BE=84=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E8=B4=A7=E5=8F=B7=20X00006=EF=BC=88=E4=B8=8E=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E6=98=8E=E7=BB=86=E9=A1=B5=E5=90=8C=E4=B8=80=E8=A7=84?= =?UTF-8?q?=E5=88=99=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 种菜订单集合 = 种菜明细表 ∪ 标签明细里「是否种菜订单=是」;后者改为命中种菜标签映射或货号含信誉订单虚拟条码 X00006 - 种菜明细表部分不再依赖标签映射是否为空 --- .../Commands/SyncStoreReceiptOrderMatches.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/Console/Commands/SyncStoreReceiptOrderMatches.php b/app/Console/Commands/SyncStoreReceiptOrderMatches.php index 1e3b0a98..944d5d0a 100644 --- a/app/Console/Commands/SyncStoreReceiptOrderMatches.php +++ b/app/Console/Commands/SyncStoreReceiptOrderMatches.php @@ -1124,7 +1124,8 @@ class SyncStoreReceiptOrderMatches extends Command /** * 种菜订单号集合:种菜明细表的订单号 ∪ 聚水潭订单标签明细里「是否种菜订单=是」的订单号。 * - * 两个条件是「或」:订单号在任意一边出现过就算种菜订单(业务口径已确认)。 + * 「是否种菜订单=是」与页面同一规则:命中种菜标签映射,或订单货号含信誉订单虚拟条码(X00006)。 + * 三个条件是「或」:订单号在任意一边出现过就算种菜订单(业务口径已确认)。 * 两边都按键清洗后的「核心单号」比较(去掉日期前缀、空格、横杠),与账单侧同一套口径。 * * @return array @@ -1138,15 +1139,19 @@ class SyncStoreReceiptOrderMatches extends Command $positiveLabels[] = $label; } } - if ($positiveLabels === []) { - return []; - } - // 并集的第一部分:聚水潭订单标签明细里命中种菜映射的订单号 $cores = []; + + // 并集的第一部分:聚水潭订单标签明细里「是否种菜订单=是」的订单号 + // (命中种菜标签映射,或货号含信誉订单虚拟条码 X00006,与页面同一规则) foreach (DB::table('jst_order_labels') ->where('company_id', $companyId) - ->whereIn('label', $positiveLabels) + ->where(function ($query) use ($positiveLabels): void { + if ($positiveLabels !== []) { + $query->whereIn('label', $positiveLabels); + } + $query->orWhereRaw('FIND_IN_SET(?, item_code) > 0', [JstOrderLabelPlantingRules::PLANTING_ITEM_CODE]); + }) ->distinct() ->pluck('order_no') as $orderNo) { $core = self::orderCoreNo((string) $orderNo);