From d93b43ba71415bd10a47cc8b87f5b4d55601fe33 Mon Sep 17 00:00:00 2001 From: renshen <1005457301@qq.com> Date: Wed, 21 Oct 2026 13:50:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=94=AE=E5=90=8E=E8=B4=B9?= =?UTF-8?q?=E7=94=A8=E5=AF=BC=E5=85=A5=EF=BC=9A=E6=8C=89=E6=95=B4=E8=A1=8C?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E7=94=9F=E6=88=90=E8=A1=8C=E9=94=AE=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E5=90=8C=E5=8D=95=E5=90=8C=E5=95=86=E5=93=81?= =?UTF-8?q?=E7=9A=84=E5=A4=9A=E8=A1=8C=E8=A2=AB=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Repositories/AfterSalesCostRowRepository.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/modules/EcommerceFinance/Repositories/AfterSalesCostRowRepository.php b/modules/EcommerceFinance/Repositories/AfterSalesCostRowRepository.php index 019131a1..57fa7358 100644 --- a/modules/EcommerceFinance/Repositories/AfterSalesCostRowRepository.php +++ b/modules/EcommerceFinance/Repositories/AfterSalesCostRowRepository.php @@ -81,16 +81,10 @@ class AfterSalesCostRowRepository */ public static function toRecord(array $payload, ?string $importedAt = null): array { - $rowKey = sha1(implode('|', [ - (string) ($payload['shop_name'] ?? ''), - (string) ($payload['online_order_no'] ?? ''), - (string) ($payload['internal_order_no'] ?? ''), - (string) ($payload['sub_order_no'] ?? ''), - (string) ($payload['after_sales_no'] ?? ''), - (string) ($payload['product_code'] ?? ''), - (string) ($payload['product_quantity'] ?? ''), - (string) ($payload['product_amount'] ?? ''), - ])); + // 以整行内容做键:同一单同一商品可能出现多行,只有完全相同的一行才合并。 + ksort($payload); + + $rowKey = sha1((string) json_encode($payload, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)); $now = $importedAt ?? now()->toDateTimeString();