From 483a67e8b53fcfda2bc6174d71404e154b295395 Mon Sep 17 00:00:00 2001 From: joan Date: Wed, 2 Feb 2022 09:26:33 +0100 Subject: [PATCH] fix(salesFilter): search by ticket id --- modules/monitor/back/methods/sales-monitor/salesFilter.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 1f1d4d88a..047095abc 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -133,6 +133,10 @@ module.exports = Self => { const where = buildFilter(ctx.args, (param, value) => { switch (param) { + case 'search': + return /^\d+$/.test(value) + ? {'t.id': {inq: value}} + : {'t.nickname': {like: `%${value}%`}}; case 'from': return {'t.shipped': {gte: value}}; case 'to':