diff --git a/app/Console/Commands/SyncStoreReceiptProductCost.php b/app/Console/Commands/SyncStoreReceiptProductCost.php index 8ddda55d..75a3848a 100644 --- a/app/Console/Commands/SyncStoreReceiptProductCost.php +++ b/app/Console/Commands/SyncStoreReceiptProductCost.php @@ -307,6 +307,11 @@ class SyncStoreReceiptProductCost extends Command $mismatchRows = 0; foreach ($billByCore as $core => $bill) { + // 展示单号与业绩明细完全一致;$core 只用于订单侧清洗后匹配。 + $displayOrderNo = (string) ($bill->online_order_no ?? ''); + if ($displayOrderNo === '') { + $displayOrderNo = $core; + } foreach ($this->costLines($lines[$core] ?? []) as $line) { $short = $shortNames['by_provider'][$line['warehouse']] ?? ''; $price = $short !== '' ? ($prices[$short . "\0" . $line['sku']] ?? null) : null; @@ -370,7 +375,7 @@ class SyncStoreReceiptProductCost extends Command 'platform' => $bill->platform, 'occurred_date' => $bill->occurred_date, 'store_name' => $bill->store_name, - 'online_order_no' => $core, + 'online_order_no' => $displayOrderNo, 'warehouse' => $line['warehouse'] !== '' ? $line['warehouse'] : null, 'warehouse_short_name' => $short !== '' ? $short : null, 'product_code' => $line['sku'], diff --git a/resources/views/business/pages/financial-operations/product-costs.blade.php b/resources/views/business/pages/financial-operations/product-costs.blade.php index 7c231fc1..3f43c36a 100644 --- a/resources/views/business/pages/financial-operations/product-costs.blade.php +++ b/resources/views/business/pages/financial-operations/product-costs.blade.php @@ -106,6 +106,7 @@