refactor: platform order list row uses model refundTotal/isRefundInconsistent

This commit is contained in:
萝卜
2026-03-11 06:33:08 +00:00
parent 1c96d4934d
commit 86f727d5a1

View File

@@ -630,25 +630,8 @@
</td> </td>
<td> <td>
@php @php
$refundSummaryTotal = data_get($order->meta, 'refund_summary.total_amount'); $refundTotal = (float) $order->refundTotal();
if ($refundSummaryTotal !== null) { $isRefundInconsistent = (bool) $order->isRefundInconsistent();
$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);
}
}
$refundShowUrl = '/admin/platform-orders/' . $order->id . '#refund-receipts'; $refundShowUrl = '/admin/platform-orders/' . $order->id . '#refund-receipts';
@endphp @endphp