平台订单列表:新建订单链接从筛选条件预填 merchant/plan/subscription

This commit is contained in:
萝卜
2026-03-13 23:25:03 +00:00
parent 06646146c8
commit a2d0de3f40
2 changed files with 93 additions and 1 deletions

View File

@@ -724,7 +724,19 @@
<h3>平台订单列表</h3>
@php
// 新建平台订单:默认携带 back 回到本页自身(剔除 back query避免嵌套
$createOrderUrl = '/admin/platform-orders/create?' . \Illuminate\Support\Arr::query(['back' => $selfWithoutBack]);
// 同时:若当前列表已筛选站点/套餐/订阅ID则预填到创建页提高运营下单效率
$createQuery = ['back' => $selfWithoutBack];
if (trim((string) ($filters['merchant_id'] ?? '')) !== '') {
$createQuery['merchant_id'] = (int) ($filters['merchant_id'] ?? 0);
}
if (trim((string) ($filters['plan_id'] ?? '')) !== '') {
$createQuery['plan_id'] = (int) ($filters['plan_id'] ?? 0);
}
if (trim((string) ($filters['site_subscription_id'] ?? '')) !== '') {
$createQuery['site_subscription_id'] = (int) ($filters['site_subscription_id'] ?? 0);
}
$createOrderUrl = '/admin/platform-orders/create?' . \Illuminate\Support\Arr::query($createQuery);
@endphp
<a href="{!! $createOrderUrl !!}" class="btn">新建平台订单</a>
</div>