platform order show: disable activate subscription for renewal missing subscription
This commit is contained in:
@@ -256,6 +256,9 @@
|
|||||||
|
|
||||||
@php
|
@php
|
||||||
$syncBlockedByGovernance = $order->isReconcileMismatch() || $order->isRefundInconsistent();
|
$syncBlockedByGovernance = $order->isReconcileMismatch() || $order->isRefundInconsistent();
|
||||||
|
// 安全阀:续费单必须绑定订阅(后端 activateSubscription 也会阻断,这里做前端提示/禁用)
|
||||||
|
$syncBlockedByMissingSubscriptionOnRenewal = ((string) ($order->order_type ?? '') === 'renewal')
|
||||||
|
&& ((int) ($order->site_subscription_id ?? 0) <= 0);
|
||||||
@endphp
|
@endphp
|
||||||
<form method="post" action="/admin/platform-orders/{{ $order->id }}/activate-subscription" onsubmit="return confirm('确认同步订阅?将根据该订单创建/续期订阅');">
|
<form method="post" action="/admin/platform-orders/{{ $order->id }}/activate-subscription" onsubmit="return confirm('确认同步订阅?将根据该订单创建/续期订阅');">
|
||||||
@csrf
|
@csrf
|
||||||
@@ -265,14 +268,21 @@
|
|||||||
? '已同步'
|
? '已同步'
|
||||||
: ($hasSyncErrorMeta ? '重试同步订阅' : '同步订阅');
|
: ($hasSyncErrorMeta ? '重试同步订阅' : '同步订阅');
|
||||||
@endphp
|
@endphp
|
||||||
<button class="btn btn-secondary btn-sm" type="submit" @disabled(! $canActivate || $alreadySynced || $syncBlockedByGovernance)>{{ $activateBtnLabel }}</button>
|
<button class="btn btn-secondary btn-sm" type="submit" @disabled(! $canActivate || $alreadySynced || $syncBlockedByGovernance || $syncBlockedByMissingSubscriptionOnRenewal)>{{ $activateBtnLabel }}</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@if($syncBlockedByGovernance)
|
@if($syncBlockedByGovernance || $syncBlockedByMissingSubscriptionOnRenewal)
|
||||||
<div class="card governance-block">
|
<div class="card governance-block">
|
||||||
<div class="muted text-danger governance-block-title"><strong>同步订阅治理提示</strong>(当前不建议/不可直接同步)</div>
|
<div class="muted text-danger governance-block-title"><strong>同步订阅治理提示</strong>(当前不建议/不可直接同步)</div>
|
||||||
<div class="muted governance-block-body">
|
<div class="muted governance-block-body">
|
||||||
<div>当前订单命中「对账不一致/退款不一致」。为避免把“带病订单”同步到订阅,请先完成金额/状态治理。</div>
|
<div>当前订单命中「对账不一致/退款不一致」。为避免把“带病订单”同步到订阅,请先完成金额/状态治理。</div>
|
||||||
|
@if($syncBlockedByMissingSubscriptionOnRenewal)
|
||||||
|
<div class="mt-6">
|
||||||
|
当前订单类型为「续费」,但未绑定订阅(site_subscription_id 为空)。
|
||||||
|
<span class="muted">|</span>
|
||||||
|
<span class="muted">请先补齐订阅关联后再重试同步。</span>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
<div class="mt-6">
|
<div class="mt-6">
|
||||||
@if($order->isReconcileMismatch())
|
@if($order->isReconcileMismatch())
|
||||||
@php
|
@php
|
||||||
|
|||||||
Reference in New Issue
Block a user