平台订单列表:退款不一致行级提示与跳转退款区

This commit is contained in:
萝卜
2026-03-11 04:47:50 +00:00
parent e6292ac665
commit ab9a230630
3 changed files with 96 additions and 3 deletions

View File

@@ -639,11 +639,33 @@
$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';
@endphp
@if($refundTotal > 0)
<span class="muted">¥{{ number_format($refundTotal, 2) }}</span>
@if($isRefundInconsistent)
<a class="link text-danger" href="{{ $refundShowUrl }}">¥{{ number_format($refundTotal, 2) }}</a>
<div class="muted text-danger muted-xs">疑似不一致</div>
@else
<a class="muted" href="{{ $refundShowUrl }}">¥{{ number_format($refundTotal, 2) }}</a>
@endif
@else
<span class="muted">-</span>
@if($isRefundInconsistent)
<a class="link text-danger" href="{{ $refundShowUrl }}">-</a>
<div class="muted text-danger muted-xs">疑似不一致</div>
@else
<span class="muted">-</span>
@endif
@endif
</td>
<td>

View File

@@ -256,7 +256,7 @@
</details>
</div>
<div class="card mb-20">
<div class="card mb-20" id="refund-receipts">
<h3>退款记录(退款轨迹留痕)</h3>
<p class="muted muted-tight">用于记录退款动作与对账轨迹(先落 meta不引入独立表。追加退款后系统会自动把支付状态推进为“部分退款/已退款”(仅在订单当前为已支付时)。</p>