From c2767a808b26e18fe126162e5afa03a2879391f4 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Sat, 24 Sep 2022 14:31:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E8=AF=A6=E6=83=85=E8=81=9A?= =?UTF-8?q?=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/alarm/data.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/api/app/lib/controllers/alarm/data.js b/api/app/lib/controllers/alarm/data.js index e8bef30..111ff2a 100644 --- a/api/app/lib/controllers/alarm/data.js +++ b/api/app/lib/controllers/alarm/data.js @@ -41,7 +41,7 @@ async function list (ctx) { ctx, pepProjectId, projectOrStructKeyword, }) let whereOption = [] - if (anxinStrucIds.length) { + if (anxinStrucIds.length ||1) { whereOption.push(`alarms.StructureId IN (${anxinStrucIds.join(",")})`) if (groupId) { @@ -87,10 +87,7 @@ async function list (ctx) { LEFT JOIN ${anxinyun}.t_alarm_code ON ${anxinyun}.t_alarm_code.code = alarms.AlarmTypeCode - ${whereOption.length ? 'WHERE ' + whereOption.join(' AND ') : ''} - ORDER BY alarms.StartTime DESC - ${limit ? 'LIMIT ' + limit : ''} - ${limit && page ? 'OFFSET ' + parseInt(limit) * parseInt(page) : ''} + `).toPromise(); // alarm_details.Time, alarm_details.Content