chore(governance): guard clear sync errors when filters conflict

This commit is contained in:
萝卜
2026-03-16 21:28:26 +08:00
parent 512de34da4
commit d3793d062a

View File

@@ -2064,6 +2064,18 @@ class PlatformOrderController extends Controller
'refund_inconsistent' => (string) $request->input('refund_inconsistent', ''), '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() $query = PlatformOrder::query()
->whereRaw("JSON_EXTRACT(meta, '$.subscription_activation_error.message') IS NOT NULL"); ->whereRaw("JSON_EXTRACT(meta, '$.subscription_activation_error.message') IS NOT NULL");