From a48617e2679166420787a0f7789275463babcf34 Mon Sep 17 00:00:00 2001 From: joan Date: Mon, 8 Nov 2021 12:50:13 +0100 Subject: [PATCH] Group first --- modules/order/back/methods/order/filter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/order/back/methods/order/filter.js b/modules/order/back/methods/order/filter.js index bd987dd5b..ddbaba5bd 100644 --- a/modules/order/back/methods/order/filter.js +++ b/modules/order/back/methods/order/filter.js @@ -172,11 +172,11 @@ module.exports = Self => { LEFT JOIN zoneEstimatedDelivery zed ON zed.zoneFk = t.zoneFk`); stmt.merge(conn.makeWhere(filter.where)); + stmt.merge(`GROUP BY id`); stmt.merge(conn.makePagination(filter)); stmts.push(stmt); stmt = new ParameterizedSQL(`SELECT * FROM tmp.filter`); - stmt.merge(`GROUP BY id`); stmt.merge(conn.makeOrderBy(filter.order)); const ordersIndex = stmts.push(stmt) - 1;