Enhance: platform order show merchant/plan links keep back to show

This commit is contained in:
萝卜
2026-03-13 19:15:43 +00:00
parent 69612847b7
commit 8d0b72ab82
2 changed files with 95 additions and 2 deletions

View File

@@ -4,6 +4,21 @@
@section('page_title', '平台订单详情')
@section('content')
@php
// 用于构建“保留当前上下文”的平台订单列表跳转链接(从详情跳回列表后可一键返回本订单详情)
$orderShowSelf = '/' . ltrim(request()->path(), '/');
$orderShowQuery = request()->query();
unset($orderShowQuery['back']);
if (count($orderShowQuery) > 0) {
$orderShowSelf .= '?' . \Illuminate\Support\Arr::query($orderShowQuery);
}
$makePlatformOrderIndexUrl = function (array $query) use ($orderShowSelf) {
$query = $query + ['back' => $orderShowSelf];
return '/admin/platform-orders?' . \Illuminate\Support\Arr::query($query);
};
@endphp
<div class="card mb-20">
<p class="muted muted-tight">这里用于运营排查订单核心字段、关联订阅、以及订阅同步元数据meta</p>
</div>
@@ -18,7 +33,7 @@
<th>站点</th>
<td>
@if($order->merchant)
<a class="link" href="/admin/platform-orders?merchant_id={{ $order->merchant->id }}">{{ $order->merchant->name }}</a>
<a class="link" href="{!! $makePlatformOrderIndexUrl(['merchant_id' => $order->merchant->id]) !!}">{{ $order->merchant->name }}</a>
@else
未关联站点
@endif
@@ -29,7 +44,7 @@
<td>
@php $planName = $order->plan_name ?: ($order->plan?->name ?? '-'); @endphp
@if($order->plan)
<a class="link" href="/admin/platform-orders?plan_id={{ $order->plan->id }}">{{ $planName }}</a>
<a class="link" href="{!! $makePlatformOrderIndexUrl(['plan_id' => $order->plan->id]) !!}">{{ $planName }}</a>
@else
{{ $planName }}
@endif