From f130efc347ff92f481e1ad5bb3448d0529e1cf5c Mon Sep 17 00:00:00 2001 From: Abdul Rahman Reza Date: Mon, 2 Dec 2024 21:13:24 +0700 Subject: [PATCH] update common helper --- src/helpers/common.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/helpers/common.ts b/src/helpers/common.ts index d37f948..8f363a1 100644 --- a/src/helpers/common.ts +++ b/src/helpers/common.ts @@ -164,17 +164,7 @@ 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; - // } - - // console.log('whereAttr', whereAttr) - + const whereAttr = whereAttrPre.join(' and ') + (whereAttrPre.length > 0 && param.additional_where && param.additional_where != '' ? ' and ' : '') + (param.additional_where ?? ''); return { whereAttr, whereVal }; }