From 645c69fa446fca9c7d7b14845a2d3f2a8ef900f7 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Fri, 28 Oct 2022 16:06:53 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E7=8A=B6=E6=80=81=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/push/config.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/api/app/lib/controllers/push/config.js b/api/app/lib/controllers/push/config.js index c6382c8..3feedea 100644 --- a/api/app/lib/controllers/push/config.js +++ b/api/app/lib/controllers/push/config.js @@ -9,16 +9,19 @@ async function list (ctx) { const { utils: { anxinStrucIdRange, pomsProjectRange } } = ctx.app.fs const { keyword, keywordTarget, alarmType, state, tactics, pomsProjectId } = ctx.query + let projectCorrelationWhere = { + del: false, + } + if (state == 'notYet') { + projectCorrelationWhere.pepProjectId = { $ne: null } + } let findOption = { where: { del: false }, include: [{ model: models.ProjectCorrelation, - where: { - del: false, - pepProjectId: state == 'notYet' ? { $ne: null } : undefined - }, + where: projectCorrelationWhere, required: true }] }