From b8805ac2c35ee97a10c538ccfc41b8366058e939 Mon Sep 17 00:00:00 2001 From: CODE <1650192445@qq.com> Date: Tue, 12 Sep 2023 09:13:53 +0800 Subject: [PATCH] fix videoAlarmSubType.length --- api/app/lib/schedule/alarms_push.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/app/lib/schedule/alarms_push.js b/api/app/lib/schedule/alarms_push.js index bc80db5..5342a24 100644 --- a/api/app/lib/schedule/alarms_push.js +++ b/api/app/lib/schedule/alarms_push.js @@ -318,14 +318,18 @@ module.exports = function (app, opts) { if (c.alarmSubType) dataAlarmSubType = dataAlarmSubType.concat(c.alarmSubType['strategy_hit']) } if (c.alarmType.includes('video_exception')) { - let videoAlarmSubType = c.alarmSubType ? c.alarmSubType['video_exception'] : [] + let videoAlarmSubType = c.alarmSubType ? + ( + c.alarmSubType['video_exception'] || [] + ) : [] if (videoAlarmSubType && videoAlarmSubType.length == 1) { // 一个参数的时候不能兼容 sql 的 in 方法 in (1,2,3) videoAlarmSubType.push(-1) } videoAlarms = searchStrucIds.length && ( - !c.alarmSubType || videoAlarmSubType.length > 0 + !c.alarmSubType || + (videoAlarmSubType && videoAlarmSubType.length > 0) ) ? await clickHouse.vcmp.query( `