feat(platform-orders): 列表/导出退款统计优先读 refund_summary(含测试)
This commit is contained in:
@@ -585,7 +585,8 @@
|
||||
<td>
|
||||
@php
|
||||
$refunds = (array) (data_get($order->meta, 'refund_receipts', []) ?? []);
|
||||
$refundCount = count($refunds);
|
||||
$refundSummaryCount = data_get($order->meta, 'refund_summary.count');
|
||||
$refundCount = $refundSummaryCount !== null ? (int) $refundSummaryCount : count($refunds);
|
||||
@endphp
|
||||
@if($refundCount > 0)
|
||||
<a href="/admin/platform-orders/{{ $order->id }}" class="muted">{{ $refundCount }}</a>
|
||||
@@ -595,9 +596,14 @@
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$refundTotal = 0.0;
|
||||
foreach ($refunds as $r) {
|
||||
$refundTotal += (float) (data_get($r, 'amount') ?? 0);
|
||||
$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);
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
@if($refundTotal > 0)
|
||||
|
||||
Reference in New Issue
Block a user