From 6ff151413ce5509522c0320941c05e39f81bcce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Wed, 11 Mar 2026 07:50:58 +0000 Subject: [PATCH] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E8=AE=A2=E5=8D=95=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=EF=BC=9A=E5=9B=9E=E6=89=A7/=E9=80=80=E6=AC=BE?= =?UTF-8?q?=E6=80=BB=E9=A2=9D=E4=B8=8E=E5=AF=B9=E8=B4=A6=E5=B7=AE=E9=A2=9D?= =?UTF-8?q?=E5=A4=8D=E7=94=A8=E6=A8=A1=E5=9E=8B=E5=8F=A3=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/PlatformOrderController.php | 37 ++----------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/app/Http/Controllers/Admin/PlatformOrderController.php b/app/Http/Controllers/Admin/PlatformOrderController.php index 879f57d..8c0d3fc 100644 --- a/app/Http/Controllers/Admin/PlatformOrderController.php +++ b/app/Http/Controllers/Admin/PlatformOrderController.php @@ -890,40 +890,9 @@ class PlatformOrderController extends Controller (string) (data_get($latestRefund, 'refunded_at') ?? ''), (float) (data_get($latestRefund, 'amount') ?? 0), (string) (data_get($latestRefund, 'channel') ?? ''), - (function () use ($order, $refunds) { - $summaryTotal = data_get($order->meta, 'refund_summary.total_amount'); - if ($summaryTotal !== null) { - return (float) $summaryTotal; - } - - $total = 0.0; - foreach ($refunds as $r) { - $total += (float) (data_get($r, 'amount') ?? 0); - } - 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); - })(), + (float) $order->refundTotal(), + (float) $order->receiptTotal(), + (float) $order->receiptTotal() - (float) ($order->paid_amount ?? 0), ]; if ($includeMeta) {