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