refs #6667 sql #1940

Merged
carlossa merged 6 commits from 6667-searchFilter into dev 2024-01-22 10:36:11 +00:00
1 changed files with 9 additions and 7 deletions
Showing only changes of commit d47429b4a7 - Show all commits

View File

@ -41,13 +41,15 @@ module.exports = Self => {
} }
const stmt = new ParameterizedSQL(` const stmt = new ParameterizedSQL(`
SELECT * SELECT *
FROM( FROM(
SELECT DISTINCT w.id, w.code, u.name, u.nickname, u.active, b.departmentFk SELECT w.id, w.code, u.name, u.nickname, u.active, b.departmentFk
FROM worker w FROM worker w
JOIN account.user u ON u.id = w.id JOIN account.user u ON u.id = w.id
LEFT JOIN business b ON b.workerFk = w.id LEFT JOIN business b ON b.workerFk = w.id
) w`); ORDER BY b.id DESC
) w
GROUP BY w.id`);
stmt.merge(conn.makeSuffix(filter)); stmt.merge(conn.makeSuffix(filter));
return conn.executeStmt(stmt); return conn.executeStmt(stmt);