From ccdef0458a566849a5381e6357a39843cfe508e3 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 17 Jan 2024 14:39:11 +0100 Subject: [PATCH] refs #6667 fix groupBy --- modules/worker/back/methods/worker/search.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/worker/back/methods/worker/search.js b/modules/worker/back/methods/worker/search.js index e423f660d..59348a9ce 100644 --- a/modules/worker/back/methods/worker/search.js +++ b/modules/worker/back/methods/worker/search.js @@ -49,10 +49,14 @@ module.exports = Self => { LEFT JOIN business b ON b.workerFk = w.id ORDER BY b.id DESC LIMIT 10000000000000000000 - ) w - GROUP BY w.id`); + ) w`); + + stmt.merge(conn.makeSuffix(filter.fields)); + stmt.merge(conn.makeWhere(filter.where)); + stmt.merge(conn.makeGroupBy('w.id')); + stmt.merge(conn.makeOrderBy(filter.order)); + stmt.merge(conn.makeLimit(filter.limit)); - stmt.merge(conn.makeSuffix(filter)); return conn.executeStmt(stmt); };