From 0f104e54103580f8b879bbfef21227496533c397 Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 19 Jan 2024 10:11:33 +0100 Subject: [PATCH] refs #6667 view workerDepartment --- modules/worker/back/methods/worker/search.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/modules/worker/back/methods/worker/search.js b/modules/worker/back/methods/worker/search.js index 59348a9ce..07bdfe240 100644 --- a/modules/worker/back/methods/worker/search.js +++ b/modules/worker/back/methods/worker/search.js @@ -43,19 +43,13 @@ module.exports = Self => { const stmt = new ParameterizedSQL(` SELECT * FROM( - SELECT w.id, w.code, u.name, u.nickname, u.active, b.departmentFk + SELECT w.id, w.code, u.name, u.nickname, u.active, wd.departmentFk FROM worker w JOIN account.user u ON u.id = w.id - LEFT JOIN business b ON b.workerFk = w.id - ORDER BY b.id DESC - LIMIT 10000000000000000000 + LEFT JOIN workerDepartment wd ON wd.workerFk = 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); };