refactor: platform orders index order_no link use Arr::query back
This commit is contained in:
@@ -760,7 +760,10 @@
|
|||||||
@forelse($orders as $order)
|
@forelse($orders as $order)
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $order->id }}</td>
|
<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>
|
<td>
|
||||||
@if($order->merchant)
|
@if($order->merchant)
|
||||||
<a href="{!! request()->fullUrlWithQuery(['merchant_id' => $order->merchant->id, 'page' => null]) !!}" class="link">{{ $order->merchant->name }}</a>
|
<a href="{!! request()->fullUrlWithQuery(['merchant_id' => $order->merchant->id, 'page' => null]) !!}" class="link">{{ $order->merchant->name }}</a>
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class AdminPlatformOrderIndexOrderNoLinkWithBackTest extends TestCase
|
|||||||
$res = $this->get('/admin/platform-orders?status=pending');
|
$res = $this->get('/admin/platform-orders?status=pending');
|
||||||
$res->assertOk();
|
$res->assertOk();
|
||||||
|
|
||||||
$expectedBack = urlencode('/admin/platform-orders?status=pending');
|
$expectedBack = \Illuminate\Support\Arr::query(['back' => '/admin/platform-orders?status=pending']);
|
||||||
$res->assertSee('/admin/platform-orders/' . $order->id . '?back=' . $expectedBack, false);
|
$res->assertSee('/admin/platform-orders/' . $order->id . '?' . $expectedBack, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user