From 7071dafafeb4c0392ba3001424f2e535a1bca264 Mon Sep 17 00:00:00 2001 From: Pierre-Gilles Leymarie Date: Sat, 9 Sep 2017 18:41:49 +0200 Subject: [PATCH] Fix #169 : Fix bug in house.checkUsersPresence() when multiple users are at home --- api/core/house/house.queries.js | 1 + 1 file changed, 1 insertion(+) diff --git a/api/core/house/house.queries.js b/api/core/house/house.queries.js index d0e24980ad..62fc1b9ae4 100644 --- a/api/core/house/house.queries.js +++ b/api/core/house/house.queries.js @@ -55,6 +55,7 @@ module.exports = { AND house = ? ORDER BY datetime DESC LIMIT 1 ) = 'back-at-home' ) + GROUP BY user.id HAVING datetime < DATE_SUB(NOW(), INTERVAL ? MINUTE) ` }; \ No newline at end of file