From 9ac54f463a9a714e092f2da8006905f5c580e2cc Mon Sep 17 00:00:00 2001 From: pablone Date: Thu, 14 Nov 2024 15:48:11 +0100 Subject: [PATCH] fix: refs #7457 add with on select to reduce --- modules/order/back/methods/order/filter.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/order/back/methods/order/filter.js b/modules/order/back/methods/order/filter.js index eff2eecb6..307843d46 100644 --- a/modules/order/back/methods/order/filter.js +++ b/modules/order/back/methods/order/filter.js @@ -23,7 +23,6 @@ module.exports = Self => { arg: 'from', type: 'date', description: 'The from date', - required: true }, { arg: 'to', type: 'date', @@ -153,7 +152,12 @@ module.exports = Self => { CREATE OR REPLACE TEMPORARY TABLE tmp.filter (INDEX (id)) ENGINE = MEMORY - SELECT o.id, + WITH wOrderTicket AS( + SELECT orderFk, + ticketFk + FROM orderTicket + GROUP BY orderFk + )SELECT o.id, o.total, o.date_send landed, o.date_make created,