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] = [