platform orders: mark activated guard for renewal missing subscription

This commit is contained in:
萝卜
2026-03-15 06:34:18 +00:00
parent 61020c5b5c
commit efc2a8a423
2 changed files with 72 additions and 0 deletions

View File

@@ -1073,6 +1073,11 @@ class PlatformOrderController extends Controller
{
$admin = $this->ensurePlatformAdmin($request);
// 治理优先:续费单必须绑定订阅(兼容历史脏数据/手工改库等场景)
if ((string) ($order->order_type ?? '') === 'renewal' && ! (int) ($order->site_subscription_id ?? 0)) {
return redirect()->back()->with('warning', '当前订单类型为「续费」但未绑定订阅site_subscription_id 为空)。为避免续期串单,请先补齐订阅关联后再标记为已生效。');
}
// 仅标记“已生效”:用于处理已支付但未生效的订单(不改 payment_status
if ($order->payment_status !== 'paid') {
return redirect()->back()->with('warning', '当前订单尚未支付,无法仅标记为已生效。');