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 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}`); }