fix(admin): 平台订单详情页退款总额口径与列表/导出一致

This commit is contained in:
萝卜
2026-03-11 00:44:46 +00:00
parent cc6835e19c
commit eac782239a

View File

@@ -44,9 +44,13 @@
<tr><th>生效时间</th><td>{{ optional($order->activated_at)->format('Y-m-d H:i:s') ?: '-' }}</td></tr>
<tr><th>退款时间</th><td>{{ optional($order->refunded_at)->format('Y-m-d H:i:s') ?: '-' }}</td></tr>
@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
<tr><th>退款总额</th><td>¥{{ number_format($refundTotal, 2) }}</td></tr>