fix(salesFilter): search by ticket id
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2022-02-02 09:26:33 +01:00
parent 8be7f9153e
commit 483a67e8b5
1 changed files with 4 additions and 0 deletions

View File

@ -133,6 +133,10 @@ module.exports = Self => {
const where = buildFilter(ctx.args, (param, value) => { const where = buildFilter(ctx.args, (param, value) => {
switch (param) { switch (param) {
case 'search':
return /^\d+$/.test(value)
? {'t.id': {inq: value}}
: {'t.nickname': {like: `%${value}%`}};
case 'from': case 'from':
return {'t.shipped': {gte: value}}; return {'t.shipped': {gte: value}};
case 'to': case 'to':