refactor: platform order show uses model receiptTotal

This commit is contained in:
萝卜
2026-03-11 06:46:09 +00:00
parent b4f1e194f6
commit 141fe762df

View File

@@ -49,16 +49,10 @@
$refundReceiptsRaw = (array) (data_get($order->meta, 'refund_receipts', []) ?? []);
$receiptCount = (int) (data_get($order->meta, 'payment_summary.count') ?? 0);
$receiptTotal = (float) (data_get($order->meta, 'payment_summary.total_amount') ?? 0);
$receiptTotal = (float) $order->receiptTotal();
if ($receiptCount <= 0) {
$receiptCount = count($paymentReceiptsRaw);
}
if ($receiptTotal <= 0) {
$receiptTotal = 0.0;
foreach ($paymentReceiptsRaw as $r) {
$receiptTotal += (float) (data_get($r, 'amount') ?? 0);
}
}
$refundCount = (int) (data_get($order->meta, 'refund_summary.count') ?? 0);
$refundTotal = (float) $order->refundTotal();