From f974eb8b75ef13b3c76cf12d78685f13bda078b3 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Sat, 24 Sep 2022 14:31:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E8=81=9A=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/utils/dataRange.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/app/lib/utils/dataRange.js b/api/app/lib/utils/dataRange.js index eeea418..ec580f1 100644 --- a/api/app/lib/utils/dataRange.js +++ b/api/app/lib/utils/dataRange.js @@ -85,7 +85,8 @@ module.exports = function (app, opts) { ).toPromise() : [] - return [...new Set(...undelStrucRes.map(s => s.strucId))] + const undelStrucIds = [...new Set(...undelStrucRes.map(s => s.strucId))] + return {} } catch (error) { ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); } From c2767a808b26e18fe126162e5afa03a2879391f4 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Sat, 24 Sep 2022 14:31:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E8=81=9A=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