From eb1c00984cd2bbbe35ff167e1da583b8693d8243 Mon Sep 17 00:00:00 2001 From: whyour Date: Tue, 20 May 2025 23:40:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E7=8A=B6=E6=80=81=E5=8C=85=E5=90=AB=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/services/cron.ts | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/back/services/cron.ts b/back/services/cron.ts index c08e8599..082aa207 100644 --- a/back/services/cron.ts +++ b/back/services/cron.ts @@ -215,14 +215,24 @@ export default class CronService { operate2 = Op.and; break; case 'In': - q[Op.or] = [ - { - [property]: Array.isArray(value) ? value : [value], - }, - property === 'status' && value.includes(2) - ? { isDisabled: 1 } - : {}, - ]; + if ( + property === 'status' && + !value.includes(CrontabStatus.disabled) + ) { + q[Op.and] = [ + { [property]: Array.isArray(value) ? value : [value] }, + { isDisabled: 0 }, + ]; + } else { + q[Op.or] = [ + { + [property]: Array.isArray(value) ? value : [value], + }, + property === 'status' && value.includes(CrontabStatus.disabled) + ? { isDisabled: 1 } + : {}, + ]; + } break; case 'Nin': q[Op.and] = [