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':