refactor(platform_orders): use BackUrl::withBackAndFragment for anchor links in index

This commit is contained in:
萝卜
2026-03-14 19:09:43 +00:00
parent 1b6476f2a4
commit d3735f83ff

View File

@@ -1222,10 +1222,10 @@
$rowDelta = (float) ($order->reconciliation_delta_row ?? 0);
// 统一口径:按分取整判断是否对账不一致,避免浮点误差导致 0.01 边界不稳定
$isReconcileMismatchRow = (bool) $order->isReconcileMismatch();
$reconcileShowUrl = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $selfWithoutBack]) . '#payment-receipts';
$reconcileShowUrl = \App\Support\BackUrl::withBackAndFragment('/admin/platform-orders/' . $order->id, $selfWithoutBack, 'payment-receipts');
@endphp
@if($isReconcileMismatchRow)
@php $reconcileFixUrl = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $selfWithoutBack]) . '#add-payment-receipt'; @endphp
@php $reconcileFixUrl = \App\Support\BackUrl::withBackAndFragment('/admin/platform-orders/' . $order->id, $selfWithoutBack, 'add-payment-receipt'); @endphp
<a class="link text-danger" href="{!! $reconcileShowUrl !!}">¥{{ number_format($rowDelta, 2) }}</a>
<div class="muted text-danger muted-xs">
对账不一致
@@ -1244,7 +1244,7 @@
@endphp
@if($receiptCount > 0)
@php
$receiptCountShowUrl = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $selfWithoutBack]) . '#payment-receipts';
$receiptCountShowUrl = \App\Support\BackUrl::withBackAndFragment('/admin/platform-orders/' . $order->id, $selfWithoutBack, 'payment-receipts');
@endphp
<a href="{!! $receiptCountShowUrl !!}" class="muted">{{ $receiptCount }}</a>
@else
@@ -1259,7 +1259,7 @@
@endphp
@if($refundCount > 0)
@php
$refundCountShowUrl = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $selfWithoutBack]) . '#refund-receipts';
$refundCountShowUrl = \App\Support\BackUrl::withBackAndFragment('/admin/platform-orders/' . $order->id, $selfWithoutBack, 'refund-receipts');
@endphp
<a href="{!! $refundCountShowUrl !!}" class="muted">{{ $refundCount }}</a>
@else
@@ -1271,11 +1271,11 @@
$refundTotal = (float) $order->refundTotal();
$isRefundInconsistent = (bool) $order->isRefundInconsistent();
$refundShowUrl = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $selfWithoutBack]) . '#refund-receipts';
$refundShowUrl = \App\Support\BackUrl::withBackAndFragment('/admin/platform-orders/' . $order->id, $selfWithoutBack, 'refund-receipts');
@endphp
@if($refundTotal > 0)
@if($isRefundInconsistent)
@php $refundFixUrl = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $selfWithoutBack]) . '#refund-receipts'; @endphp
@php $refundFixUrl = \App\Support\BackUrl::withBackAndFragment('/admin/platform-orders/' . $order->id, $selfWithoutBack, 'refund-receipts'); @endphp
<a class="link text-danger" href="{!! $refundShowUrl !!}">¥{{ number_format($refundTotal, 2) }}</a>
<div class="muted text-danger muted-xs">
疑似不一致
@@ -1307,8 +1307,8 @@
// 精简视图也要可达的“治理入口”不要只依赖可选列col-optional里的提示
$needReconcileFix = (bool) $order->isReconcileMismatch();
$needRefundFix = (bool) $order->isRefundInconsistent();
$reconcileFixUrlCompact = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $selfWithoutBack]) . '#add-payment-receipt';
$refundFixUrlCompact = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $selfWithoutBack]) . '#refund-receipts';
$reconcileFixUrlCompact = \App\Support\BackUrl::withBackAndFragment('/admin/platform-orders/' . $order->id, $selfWithoutBack, 'add-payment-receipt');
$refundFixUrlCompact = \App\Support\BackUrl::withBackAndFragment('/admin/platform-orders/' . $order->id, $selfWithoutBack, 'refund-receipts');
@endphp
@if($needReconcileFix || $needRefundFix)