diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php index df56738..f3a8852 100644 --- a/resources/views/admin/platform_orders/index.blade.php +++ b/resources/views/admin/platform_orders/index.blade.php @@ -1780,11 +1780,19 @@ $syncErrorAt = data_get($order->meta, 'subscription_activation_error.at'); @endphp @php - $canMarkPaid = ($order->payment_status !== 'paid') || ($order->status !== 'activated'); - - // 精简视图也要可达的“治理入口”:不要只依赖可选列(col-optional)里的提示 $needReconcileFix = (bool) $order->isReconcileMismatch(); $needRefundFix = (bool) $order->isRefundInconsistent(); + + // 行级 BMPA 安全阀(列表页也应禁用,避免运营误触): + // - 对账不一致/退款不一致:需先治理 + // - 续费缺订阅:需先绑定订阅 + $blockedByMissingSubscriptionOnRenewal = ((string) ($order->order_type ?? '') === 'renewal') && ((int) ($order->site_subscription_id ?? 0) <= 0); + $markPaidBlockedByGovernance = $needReconcileFix || $needRefundFix || $blockedByMissingSubscriptionOnRenewal; + + // 仅当订单尚未处于 paid+activated 时,且未命中治理阻断时,才允许点击 + $canMarkPaid = ((($order->payment_status !== 'paid') || ($order->status !== 'activated')) && (! $markPaidBlockedByGovernance)); + + // 精简视图也要可达的“治理入口”:不要只依赖可选列(col-optional)里的提示 $reconcileFixUrlCompact = \App\Support\BackUrl::withBackAndFragment('/admin/platform-orders/' . $order->id, $selfWithoutBack, 'add-payment-receipt'); $refundFixUrlCompact = \App\Support\BackUrl::withBackAndFragment('/admin/platform-orders/' . $order->id, $selfWithoutBack, 'add-refund-receipt'); @endphp