diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php index 54fd71b..62a1ac3 100644 --- a/resources/views/admin/platform_orders/index.blade.php +++ b/resources/views/admin/platform_orders/index.blade.php @@ -51,6 +51,31 @@ 'lead_id' => null, 'page' => null, ], $safeBackForLinks); + + // 新建平台订单:统一入口(页面顶部),并尽量预填当前筛选上下文,提高运营下单效率 + // - 默认携带 back 回到本页自身(剔除 back query,避免嵌套) + // - 若当前列表已筛选站点/套餐/订阅ID/线索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); + // 治理口径:当从订阅维度锁定进入时: + // 1) 显式声明 require_subscription=1(统一来源口径/便于排查链路来源) + // 2) 显式声明 order_type=renewal(语义更清晰;create 页仍会二次强制兜底) + $createQuery['require_subscription'] = '1'; + $createQuery['order_type'] = 'renewal'; + } + // 线索联动:若当前列表已按 lead_id 锁定,则新建订单也应带上 lead_id,维持闭环追溯 + if (trim((string) ($filters['lead_id'] ?? '')) !== '') { + $createQuery['lead_id'] = (int) ($filters['lead_id'] ?? 0); + } + + $createOrderUrl = '/admin/platform-orders/create?' . \Illuminate\Support\Arr::query($createQuery); @endphp @@ -1075,31 +1097,7 @@

平台订单列表

- @php - // 新建平台订单:默认携带 back 回到本页自身(剔除 back query,避免嵌套) - // 同时:若当前列表已筛选站点/套餐/订阅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); - // 治理口径:当从订阅维度锁定进入时: - // 1) 显式声明 require_subscription=1(统一来源口径/便于排查链路来源) - // 2) 显式声明 order_type=renewal(语义更清晰;create 页仍会二次强制兜底) - $createQuery['require_subscription'] = '1'; - $createQuery['order_type'] = 'renewal'; - } - // 线索联动:若当前列表已按 lead_id 锁定,则新建订单也应带上 lead_id,维持闭环追溯 - if (trim((string) ($filters['lead_id'] ?? '')) !== '') { - $createQuery['lead_id'] = (int) ($filters['lead_id'] ?? 0); - } - - $createOrderUrl = '/admin/platform-orders/create?' . \Illuminate\Support\Arr::query($createQuery); - @endphp + {{-- 新建平台订单链接已在页面顶部统一生成($createOrderUrl),避免口径漂移与重复入口 --}} @php $toggleViewUrl = $isFullView ? $safeFullUrlWithQuery(['view' => null, 'page' => null]) @@ -1108,7 +1106,6 @@ @endphp
{{ $toggleViewLabel }} - 新建平台订单