Tarea #1724 order/index buscar por alias

This commit is contained in:
Bernat 2019-09-24 12:10:03 +02:00
parent a319eed5f6
commit 7384fabec0
1 changed files with 6 additions and 1 deletions

View File

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