platform order show: add link to subscriptions when renewal missing subscription
This commit is contained in:
@@ -259,6 +259,15 @@
|
||||
// 安全阀:续费单必须绑定订阅(后端 activateSubscription 也会阻断,这里做前端提示/禁用)
|
||||
$syncBlockedByMissingSubscriptionOnRenewal = ((string) ($order->order_type ?? '') === 'renewal')
|
||||
&& ((int) ($order->site_subscription_id ?? 0) <= 0);
|
||||
|
||||
$missingSubscriptionHelpUrl = '';
|
||||
if ($syncBlockedByMissingSubscriptionOnRenewal) {
|
||||
$missingSubscriptionHelpUrl = \App\Support\BackUrl::withBack('/admin/site-subscriptions?' . \Illuminate\Support\Arr::query([
|
||||
'merchant_id' => (int) ($order->merchant_id ?? 0) ?: null,
|
||||
'plan_id' => (int) ($order->plan_id ?? 0) ?: null,
|
||||
'page' => null,
|
||||
]), $orderShowSelf);
|
||||
}
|
||||
@endphp
|
||||
<form method="post" action="/admin/platform-orders/{{ $order->id }}/activate-subscription" onsubmit="return confirm('确认同步订阅?将根据该订单创建/续期订阅');">
|
||||
@csrf
|
||||
@@ -281,6 +290,10 @@
|
||||
当前订单类型为「续费」,但未绑定订阅(site_subscription_id 为空)。
|
||||
<span class="muted">|</span>
|
||||
<span class="muted">请先补齐订阅关联后再重试同步。</span>
|
||||
@if($missingSubscriptionHelpUrl !== '')
|
||||
<span class="muted">|</span>
|
||||
<a class="btn btn-secondary btn-sm" href="{!! $missingSubscriptionHelpUrl !!}">去订阅管理查找订阅</a>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
<div class="mt-6">
|
||||
|
||||
Reference in New Issue
Block a user