From 69aced960c59c6e79db6ad2cbc63aef781a8eacd Mon Sep 17 00:00:00 2001 From: CODE <1650192445@qq.com> Date: Wed, 13 Sep 2023 15:18:19 +0800 Subject: [PATCH] SELECT count(id) AS count FROM Device WHERE thingId --- api/app/lib/schedule/alarms_push.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/app/lib/schedule/alarms_push.js b/api/app/lib/schedule/alarms_push.js index 553c947..356d097 100644 --- a/api/app/lib/schedule/alarms_push.js +++ b/api/app/lib/schedule/alarms_push.js @@ -284,7 +284,7 @@ module.exports = function (app, opts) { let deviceCountRes = strucThingId.length ? await clickHouse.iot.query(` - SELECT count(DeviceId) AS count FROM Device WHERE ThingId IN (${strucThingId.map(t => `'${t}'`).join(',')}, '-1') + SELECT count(id) AS count FROM Device WHERE thingId IN (${strucThingId.map(t => `'${t}'`).join(',')}, '-1') `).toPromise() : [] deviceCount = deviceCountRes.length ? deviceCountRes[0].count : 0