|
|
@ -261,16 +261,17 @@ const parseConditionV2 = async ( |
|
|
|
filter.comparison_op === 'notempty' |
|
|
|
filter.comparison_op === 'notempty' |
|
|
|
) |
|
|
|
) |
|
|
|
filter.value = ''; |
|
|
|
filter.value = ''; |
|
|
|
let field = sanitize( |
|
|
|
const _field = sanitize( |
|
|
|
customWhereClause |
|
|
|
customWhereClause |
|
|
|
? filter.value |
|
|
|
? filter.value |
|
|
|
: alias |
|
|
|
: alias |
|
|
|
? `${alias}.${column.column_name}` |
|
|
|
? `${alias}.${column.column_name}` |
|
|
|
: column.column_name |
|
|
|
: column.column_name |
|
|
|
); |
|
|
|
); |
|
|
|
let val = customWhereClause ? customWhereClause : filter.value; |
|
|
|
const _val = customWhereClause ? customWhereClause : filter.value; |
|
|
|
|
|
|
|
|
|
|
|
return (qb) => { |
|
|
|
return (qb) => { |
|
|
|
|
|
|
|
let [field, val] = [_field, _val]; |
|
|
|
switch (filter.comparison_op) { |
|
|
|
switch (filter.comparison_op) { |
|
|
|
case 'eq': |
|
|
|
case 'eq': |
|
|
|
qb = qb.where(field, val); |
|
|
|
qb = qb.where(field, val); |
|
|
|