diff --git a/src/helpers/common.ts b/src/helpers/common.ts index 5284eb9..4416c65 100644 --- a/src/helpers/common.ts +++ b/src/helpers/common.ts @@ -93,6 +93,11 @@ export default class CommonHelper { whereVal[p + '_to'] = fr['to']; found = true; } + if (fr['like']) { + whereAttrPre.push('LOWER(' + p + ') like :' + p + '_like'); + whereVal[p + '_like'] = '%' + fr['like'].toLowerCase() + '%';; + found = true; + } if (!found) { whereAttrPre.push("LOWER(" + p + ") = :" + p); @@ -157,7 +162,7 @@ export default class CommonHelper { if (param.col_any_like.length > 0) { const liker = []; for (let c of param.col_any_like) { - liker.push(c + ' like :filter_like'); + liker.push('LOWER(' + c + ') like :filter_like'); } const like = '(' + liker.join(' or ') + ')';