From b73eceb1c8341ad2f93b945ace10f74bca7de099 Mon Sep 17 00:00:00 2001 From: pablone Date: Mon, 22 Jul 2024 13:33:51 +0200 Subject: [PATCH] fix: refs #7129 fix backFilters --- modules/route/back/methods/route/filter.js | 9 ++++----- modules/route/back/methods/route/getByWorker.js | 14 +++++++------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/modules/route/back/methods/route/filter.js b/modules/route/back/methods/route/filter.js index 8f90fc532..925927cc8 100644 --- a/modules/route/back/methods/route/filter.js +++ b/modules/route/back/methods/route/filter.js @@ -96,16 +96,15 @@ module.exports = Self => { return {'created': {gte: value}}; case 'to': return {'created': {lte: value}}; - case 'm3': - return {'m3': value}; case 'description': return {'description': {like: `%${value}%`}}; + case 'isOk': + case 'm3': case 'warehouseFk': - return {[param]: value}; + case 'workerFk': + case 'vehicleFk': case 'agencyModeFk': return {[param]: value}; - case 'isOk': - return {'isOk': value}; } }); diff --git a/modules/route/back/methods/route/getByWorker.js b/modules/route/back/methods/route/getByWorker.js index 9243cfbfb..5d1881c20 100644 --- a/modules/route/back/methods/route/getByWorker.js +++ b/modules/route/back/methods/route/getByWorker.js @@ -28,11 +28,11 @@ module.exports = Self => { if (canViewAll) { const userConfig = await models.UserConfig.getUserConfig(ctx, myOptions); filterGrant = { - where: {'a.warehouseFk': userConfig.warehouseFk} + where: {'warehouseFk': userConfig.warehouseFk} }; } else { filterGrant = { - where: {'r.workerFk': userId} + where: {'workerFk': userId} }; } @@ -46,16 +46,16 @@ module.exports = Self => { and: [ { or: [ - {'r.created': currentDate}, - {'r.created': nextDay} + {'created': currentDate}, + {'created': nextDay} ] } ] }, order: [ - 'r.created ASC', - 'r.time ASC', - 'am.name ASC' + 'created ASC', + 'time ASC', + 'agencyName ASC' ] };