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;