From eac782239a761061c4f22e67d40b09455ca5b053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Wed, 11 Mar 2026 00:44:46 +0000 Subject: [PATCH] =?UTF-8?q?fix(admin):=20=E5=B9=B3=E5=8F=B0=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E8=AF=A6=E6=83=85=E9=A1=B5=E9=80=80=E6=AC=BE=E6=80=BB?= =?UTF-8?q?=E9=A2=9D=E5=8F=A3=E5=BE=84=E4=B8=8E=E5=88=97=E8=A1=A8/?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/admin/platform_orders/show.blade.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/resources/views/admin/platform_orders/show.blade.php b/resources/views/admin/platform_orders/show.blade.php index a2e953b..9f1d62c 100644 --- a/resources/views/admin/platform_orders/show.blade.php +++ b/resources/views/admin/platform_orders/show.blade.php @@ -44,9 +44,13 @@ 生效时间{{ optional($order->activated_at)->format('Y-m-d H:i:s') ?: '-' }} 退款时间{{ optional($order->refunded_at)->format('Y-m-d H:i:s') ?: '-' }} @php - $refundTotal = 0.0; - foreach ((array) (data_get($order->meta, 'refund_receipts', []) ?? []) as $r) { - $refundTotal += (float) (data_get($r, 'amount') ?? 0); + // 退款总额口径:优先读扁平字段 meta.refund_summary.total_amount(与列表/导出口径一致);缺省回退汇总 refund_receipts[].amount + $refundTotal = (float) (data_get($order->meta, 'refund_summary.total_amount') ?? 0); + if ($refundTotal <= 0) { + $refundTotal = 0.0; + foreach ((array) (data_get($order->meta, 'refund_receipts', []) ?? []) as $r) { + $refundTotal += (float) (data_get($r, 'amount') ?? 0); + } } @endphp 退款总额¥{{ number_format($refundTotal, 2) }}