From b39c79d370f5e5cf1e17e0b338e726b0d18ad8bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Tue, 10 Mar 2026 21:05:14 +0000 Subject: [PATCH] =?UTF-8?q?feat(platform-orders):=20=E5=AF=BC=E5=87=BACSV?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9B=9E=E6=89=A7=E6=80=BB=E9=A2=9D=E4=B8=8E?= =?UTF-8?q?=E5=AF=B9=E8=B4=A6=E5=B7=AE=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/PlatformOrderController.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/app/Http/Controllers/Admin/PlatformOrderController.php b/app/Http/Controllers/Admin/PlatformOrderController.php index ca25f0b..cabaffa 100644 --- a/app/Http/Controllers/Admin/PlatformOrderController.php +++ b/app/Http/Controllers/Admin/PlatformOrderController.php @@ -611,6 +611,8 @@ class PlatformOrderController extends Controller '最近退款金额', '最近退款渠道', '退款总额', + '回执总额', + '对账差额', ]; if ($includeMeta) { @@ -677,6 +679,28 @@ class PlatformOrderController extends Controller } return $total; })(), + (function () use ($order, $receipts) { + // 回执总额:优先读 payment_summary.total_amount;缺省回退遍历 payment_receipts[].amount + $t = (float) (data_get($order->meta, 'payment_summary.total_amount') ?? 0); + if ($t > 0) { + return $t; + } + + $sum = 0.0; + foreach ($receipts as $r) { + $sum += (float) (data_get($r, 'amount') ?? 0); + } + return $sum; + })(), + (function () use ($order, $receipts) { + $receiptTotal = (float) (data_get($order->meta, 'payment_summary.total_amount') ?? 0); + if ($receiptTotal <= 0) { + foreach ($receipts as $r) { + $receiptTotal += (float) (data_get($r, 'amount') ?? 0); + } + } + return (float) $receiptTotal - (float) ($order->paid_amount ?? 0); + })(), ]; if ($includeMeta) {