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