From 7384fabec0904e6e0baa33c81af666400e8dc7aa Mon Sep 17 00:00:00 2001 From: Bernat Date: Tue, 24 Sep 2019 12:10:03 +0200 Subject: [PATCH] Tarea #1724 order/index buscar por alias --- modules/order/back/methods/order/filter.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/order/back/methods/order/filter.js b/modules/order/back/methods/order/filter.js index 5dffef195..1eaa167a7 100644 --- a/modules/order/back/methods/order/filter.js +++ b/modules/order/back/methods/order/filter.js @@ -96,7 +96,12 @@ module.exports = Self => { let where = buildFilter(ctx.args, (param, value) => { switch (param) { case 'search': - return {'o.id': value}; + return /^\d+$/.test(value) + ? {'o.id': value} + : {or: [ + {'c.name': {like: `%${value}%`}} + ]}; + // return {'o.id': value}; case 'from': return {'o.date_send': {gte: value}}; case 'to':