PlatformOrder create: add jump to subscriptions link when require_subscription

This commit is contained in:
萝卜
2026-03-15 02:41:29 +00:00
parent 3182dd72a0
commit df416da7f8
2 changed files with 65 additions and 0 deletions

View File

@@ -135,6 +135,29 @@
</select>
@if(! $canRenew)
<small class="muted">提示:续费单必须绑定订阅。请从「订阅管理」列表/详情进入“续费下单”系统会自动带入订阅ID。</small>
@php
$jumpQuery = [];
if ((int) ($defaults['merchant_id'] ?? 0) > 0) {
$jumpQuery['merchant_id'] = (int) ($defaults['merchant_id'] ?? 0);
}
if ((int) ($defaults['plan_id'] ?? 0) > 0) {
$jumpQuery['plan_id'] = (int) ($defaults['plan_id'] ?? 0);
}
$jumpBase = '/admin/site-subscriptions';
if (count($jumpQuery) > 0) {
$jumpBase .= '?' . \Illuminate\Support\Arr::query($jumpQuery);
}
$jumpUrl = \App\Support\BackUrl::withBack($jumpBase, \App\Support\BackUrl::selfWithoutBack());
@endphp
@if(($requireSubscription ?? false) && $jumpUrl)
<div class="mt-6 actions">
<a class="btn btn-secondary btn-sm" href="{!! $jumpUrl !!}">去订阅管理选择订阅</a>
</div>
@endif
@endif
</label>