From 86f727d5a1468de8764d255e28ade6638c8ea20d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Wed, 11 Mar 2026 06:33:08 +0000 Subject: [PATCH] refactor: platform order list row uses model refundTotal/isRefundInconsistent --- .../admin/platform_orders/index.blade.php | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php index d36e15b..8ce9165 100644 --- a/resources/views/admin/platform_orders/index.blade.php +++ b/resources/views/admin/platform_orders/index.blade.php @@ -630,25 +630,8 @@ @php - $refundSummaryTotal = data_get($order->meta, 'refund_summary.total_amount'); - if ($refundSummaryTotal !== null) { - $refundTotal = (float) $refundSummaryTotal; - } else { - $refundTotal = 0.0; - foreach ($refunds as $r) { - $refundTotal += (float) (data_get($r, 'amount') ?? 0); - } - } - - $paidAmountFloat = (float) ($order->paid_amount ?? 0); - $isRefundInconsistent = false; - if ($paidAmountFloat > 0) { - if ((string) $order->payment_status === 'refunded') { - $isRefundInconsistent = (round($refundTotal * 100) + 1) < round($paidAmountFloat * 100); - } else { - $isRefundInconsistent = round($refundTotal * 100) >= round($paidAmountFloat * 100); - } - } + $refundTotal = (float) $order->refundTotal(); + $isRefundInconsistent = (bool) $order->isRefundInconsistent(); $refundShowUrl = '/admin/platform-orders/' . $order->id . '#refund-receipts'; @endphp