update common fomr

This commit is contained in:
2024-12-02 13:55:36 +07:00
parent 2722ba8d95
commit 3131c3f270

View File

@ -144,7 +144,9 @@ export default class CommonHelper {
wtp.push(like);
}
whereAttrPre.push('(' + wtp.join(' or ') + ')');
if (wtp.length > 0) {
whereAttrPre.push('(' + wtp.join(' or ') + ')');
}
if (param.col_any_eq.length > 0) {
whereVal['filter_eq'] = filter_any_val;
@ -175,7 +177,10 @@ export default class CommonHelper {
wtp.push(like);
}
whereAttrPre.push('(' + wtp.join(' or ') + ')');
if (wtp.length > 0) {
whereAttrPre.push('(' + wtp.join(' or ') + ')');
}
if (param.col_any_eq.length > 0) {
whereVal['filter_eq'] = param.filter.toLowerCase();
@ -186,8 +191,12 @@ export default class CommonHelper {
}
}
const whereAttr = whereAttrPre.join(' and ') + (whereAttrPre.length > 0 && param.additional_where != '' ? ' and ' : '') + param.additional_where;
let whereAttr = '';
if (whereAttrPre.length > 0) {
whereAttr = whereAttrPre.join(' and ') + (whereAttrPre.length > 0 && param.additional_where != '' ? ' and ' : '') + param.additional_where;
} else {
whereAttr += param.additional_where;
}
return { whereAttr, whereVal };