From d3793d062a19d83a9238edbc236868b7b64da295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Mon, 16 Mar 2026 21:28:26 +0800 Subject: [PATCH] chore(governance): guard clear sync errors when filters conflict --- .../Controllers/Admin/PlatformOrderController.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/Http/Controllers/Admin/PlatformOrderController.php b/app/Http/Controllers/Admin/PlatformOrderController.php index 7c50634..7339d78 100644 --- a/app/Http/Controllers/Admin/PlatformOrderController.php +++ b/app/Http/Controllers/Admin/PlatformOrderController.php @@ -2064,6 +2064,18 @@ class PlatformOrderController extends Controller 'refund_inconsistent' => (string) $request->input('refund_inconsistent', ''), ]; + // 防误操作(后端兜底):清理“同步失败”标记时,不允许叠加与失败集合互斥的筛选。 + // 说明:列表页 UI 已做按钮禁用,但仍需后端兜底以防绕过 UI 直接 POST。 + if ($scope === 'filtered') { + $syncStatus = (string) ($filters['sync_status'] ?? ''); + if ($syncStatus !== '' && $syncStatus !== 'failed') { + return redirect()->back()->with('warning', '当前为「清理同步失败标记」动作:若需要筛选同步状态,请使用 sync_status=failed(或清空该筛选)后再执行。'); + } + if ((string) ($filters['syncable_only'] ?? '') === '1') { + return redirect()->back()->with('warning', '当前已勾选「只看可同步」:该集合与「同步失败」互斥,请先取消只看可同步或切到失败集合后再清理。'); + } + } + $query = PlatformOrder::query() ->whereRaw("JSON_EXTRACT(meta, '$.subscription_activation_error.message') IS NOT NULL");