refactor: platform orders index order_no link use Arr::query back

This commit is contained in:
萝卜
2026-03-13 22:23:24 +00:00
parent 976a9537c2
commit 6a666b4c2a
2 changed files with 6 additions and 3 deletions

View File

@@ -760,7 +760,10 @@
@forelse($orders as $order)
<tr>
<td>{{ $order->id }}</td>
<td><a href="/admin/platform-orders/{{ $order->id }}?back={{ urlencode($selfWithoutBack) }}">{{ $order->order_no }}</a></td>
@php
$orderShowUrl = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $selfWithoutBack]);
@endphp
<td><a href="{!! $orderShowUrl !!}">{{ $order->order_no }}</a></td>
<td>
@if($order->merchant)
<a href="{!! request()->fullUrlWithQuery(['merchant_id' => $order->merchant->id, 'page' => null]) !!}" class="link">{{ $order->merchant->name }}</a>

View File

@@ -56,7 +56,7 @@ class AdminPlatformOrderIndexOrderNoLinkWithBackTest extends TestCase
$res = $this->get('/admin/platform-orders?status=pending');
$res->assertOk();
$expectedBack = urlencode('/admin/platform-orders?status=pending');
$res->assertSee('/admin/platform-orders/' . $order->id . '?back=' . $expectedBack, false);
$expectedBack = \Illuminate\Support\Arr::query(['back' => '/admin/platform-orders?status=pending']);
$res->assertSee('/admin/platform-orders/' . $order->id . '?' . $expectedBack, false);
}
}