全量回归:平台订单行级提示链接携带back(同步更新测试断言)

This commit is contained in:
萝卜
2026-03-14 17:59:46 +00:00
parent 2d380e180b
commit 4aa44258f8
3 changed files with 25 additions and 19 deletions

View File

@@ -1076,7 +1076,7 @@
@php @php
$hasReceiptEvidenceRow = (data_get($order->meta, 'payment_summary.total_amount') !== null) $hasReceiptEvidenceRow = (data_get($order->meta, 'payment_summary.total_amount') !== null)
|| (data_get($order->meta, 'payment_receipts.0.amount') !== null); || (data_get($order->meta, 'payment_receipts.0.amount') !== null);
$noReceiptFixUrlRow = '/admin/platform-orders/' . $order->id . '#add-payment-receipt'; $noReceiptFixUrlRow = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $selfWithoutBack]) . '#add-payment-receipt';
@endphp @endphp
@if($order->payment_status === 'paid' && ! $hasReceiptEvidenceRow) @if($order->payment_status === 'paid' && ! $hasReceiptEvidenceRow)
<div class="muted text-danger muted-xs row-warn"> <div class="muted text-danger muted-xs row-warn">
@@ -1287,10 +1287,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 . '#payment-receipts'; $reconcileShowUrl = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $selfWithoutBack]) . '#payment-receipts';
@endphp @endphp
@if($isReconcileMismatchRow) @if($isReconcileMismatchRow)
@php $reconcileFixUrl = '/admin/platform-orders/' . $order->id . '#add-payment-receipt'; @endphp @php $reconcileFixUrl = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $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">
对账不一致 对账不一致
@@ -1309,7 +1309,7 @@
@endphp @endphp
@if($receiptCount > 0) @if($receiptCount > 0)
@php @php
$receiptCountShowUrl = '/admin/platform-orders/' . $order->id . '#payment-receipts'; $receiptCountShowUrl = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $selfWithoutBack]) . '#payment-receipts';
@endphp @endphp
<a href="{!! $receiptCountShowUrl !!}" class="muted">{{ $receiptCount }}</a> <a href="{!! $receiptCountShowUrl !!}" class="muted">{{ $receiptCount }}</a>
@else @else
@@ -1324,7 +1324,7 @@
@endphp @endphp
@if($refundCount > 0) @if($refundCount > 0)
@php @php
$refundCountShowUrl = '/admin/platform-orders/' . $order->id . '#refund-receipts'; $refundCountShowUrl = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $selfWithoutBack]) . '#refund-receipts';
@endphp @endphp
<a href="{!! $refundCountShowUrl !!}" class="muted">{{ $refundCount }}</a> <a href="{!! $refundCountShowUrl !!}" class="muted">{{ $refundCount }}</a>
@else @else
@@ -1336,11 +1336,11 @@
$refundTotal = (float) $order->refundTotal(); $refundTotal = (float) $order->refundTotal();
$isRefundInconsistent = (bool) $order->isRefundInconsistent(); $isRefundInconsistent = (bool) $order->isRefundInconsistent();
$refundShowUrl = '/admin/platform-orders/' . $order->id . '#refund-receipts'; $refundShowUrl = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $selfWithoutBack]) . '#refund-receipts';
@endphp @endphp
@if($refundTotal > 0) @if($refundTotal > 0)
@if($isRefundInconsistent) @if($isRefundInconsistent)
@php $refundFixUrl = '/admin/platform-orders/' . $order->id . '#refund-receipts'; @endphp @php $refundFixUrl = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $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">
疑似不一致 疑似不一致
@@ -1372,8 +1372,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 . '#add-payment-receipt'; $reconcileFixUrlCompact = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $selfWithoutBack]) . '#add-payment-receipt';
$refundFixUrlCompact = '/admin/platform-orders/' . $order->id . '#refund-receipts'; $refundFixUrlCompact = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $selfWithoutBack]) . '#refund-receipts';
@endphp @endphp
@if($needReconcileFix || $needRefundFix) @if($needReconcileFix || $needRefundFix)

View File

@@ -62,11 +62,14 @@ class AdminPlatformOrderReconcileMismatchRowHintTest extends TestCase
], ],
]); ]);
$this->get('/admin/platform-orders?reconcile_mismatch=1') $res = $this->get('/admin/platform-orders?reconcile_mismatch=1');
->assertOk() $res->assertOk();
->assertSee('PO_RECON_ROW_HINT_0001') $res->assertSee('PO_RECON_ROW_HINT_0001');
->assertSee('/admin/platform-orders/' . $order->id . '#payment-receipts', false)
->assertSee('/admin/platform-orders/' . $order->id . '#add-payment-receipt', false) $indexSelfWithoutBack = '/admin/platform-orders?reconcile_mismatch=1';
->assertSee('对账不一致');
$res->assertSee('/admin/platform-orders/' . $order->id . '?back=' . urlencode($indexSelfWithoutBack) . '#payment-receipts', false);
$res->assertSee('/admin/platform-orders/' . $order->id . '?back=' . urlencode($indexSelfWithoutBack) . '#add-payment-receipt', false);
$res->assertSee('对账不一致');
} }
} }

View File

@@ -63,9 +63,12 @@ class AdminPlatformOrderRefundInconsistentRowHintFixLinkTest extends TestCase
], ],
]); ]);
$this->get('/admin/platform-orders?refund_inconsistent=1') $res = $this->get('/admin/platform-orders?refund_inconsistent=1');
->assertOk() $res->assertOk();
->assertSee('/admin/platform-orders/' . $order->id . '#refund-receipts', false)
->assertSee('去核对退款'); $indexSelfWithoutBack = '/admin/platform-orders?refund_inconsistent=1';
$res->assertSee('/admin/platform-orders/' . $order->id . '?back=' . urlencode($indexSelfWithoutBack) . '#refund-receipts', false);
$res->assertSee('去核对退款');
} }
} }