feat(admin): 线索页补齐创建续费订单入口(require_subscription)
This commit is contained in:
@@ -48,6 +48,29 @@
|
||||
|
||||
return '/admin/platform-orders/create?' . \Illuminate\Support\Arr::query($q);
|
||||
};
|
||||
|
||||
// 从线索直达“创建续费订单”入口:本质是 require_subscription 治理链路。
|
||||
// 线索自身通常没有订阅ID,因此这里不直接传 site_subscription_id,而是引导先去订阅管理选择订阅再返回。
|
||||
$buildCreateRenewalOrderUrl = function (\App\Models\PlatformLead $l) use ($selfWithoutBack) {
|
||||
$q = [];
|
||||
|
||||
if ((int) $l->plan_id > 0) {
|
||||
$q['plan_id'] = (int) $l->plan_id;
|
||||
}
|
||||
|
||||
$meta = is_array($l->meta) ? $l->meta : [];
|
||||
$merchantId = (int) ($meta['merchant_id'] ?? 0);
|
||||
if ($merchantId > 0) {
|
||||
$q['merchant_id'] = $merchantId;
|
||||
}
|
||||
|
||||
// require_subscription:用于“续费必须先选订阅”的治理 UI 口径
|
||||
$q['require_subscription'] = '1';
|
||||
$q['lead_id'] = (int) $l->id;
|
||||
$q['back'] = $selfWithoutBack;
|
||||
|
||||
return '/admin/platform-orders/create?' . \Illuminate\Support\Arr::query($q);
|
||||
};
|
||||
@endphp
|
||||
|
||||
<div class="card mb-20">
|
||||
@@ -155,6 +178,7 @@
|
||||
<td>
|
||||
<div class="actions">
|
||||
<a class="btn btn-sm" href="{!! $buildCreatePlatformOrderUrl($l) !!}">创建订单</a>
|
||||
<a class="btn btn-secondary btn-sm" href="{!! $buildCreateRenewalOrderUrl($l) !!}">创建续费订单</a>
|
||||
|
||||
@php
|
||||
$viewOrdersUrl = '/admin/platform-orders?' . \Illuminate\Support\Arr::query([
|
||||
|
||||
Reference in New Issue
Block a user