平台订单列表:锁定订阅时提供一键续费下单入口

This commit is contained in:
萝卜
2026-03-13 23:39:01 +00:00
parent 8841238fb6
commit 8de646434c
2 changed files with 103 additions and 0 deletions

View File

@@ -42,6 +42,29 @@
<span class="muted">订阅ID{{ $currentSubscription->id }}</span>
</div>
<div class="muted muted-xs">提示本页快捷筛选会保留该订阅ID右上角“新建平台订单”会自动预填订阅ID。</div>
@php
// 锁定订阅场景下的一键续费下单入口(更贴近收费闭环 SOP
$renewRemarkPrefix = (string) config('saasshop.platform_orders.renewal_order_remark_prefix', '来自订阅:');
$renewCreateQuery = [
'order_type' => 'renewal',
'site_subscription_id' => $currentSubscription->id,
'merchant_id' => $currentSubscription->merchant_id,
'plan_id' => $currentSubscription->plan_id,
'quantity' => 1,
'remark' => $renewRemarkPrefix . $currentSubscription->subscription_no,
'back' => $selfWithoutBack,
];
// plan_id 允许为空:为空时不传,避免 create 默认值误选 0
if (!(int) $currentSubscription->plan_id) {
unset($renewCreateQuery['plan_id']);
}
$renewCreateUrl = '/admin/platform-orders/create?' . \Illuminate\Support\Arr::query($renewCreateQuery);
@endphp
<div class="mt-10">
<a href="{!! $renewCreateUrl !!}" class="btn">为该订阅创建续费订单</a>
</div>
</div>
@endif
</div>