|
|
@ -210,10 +210,6 @@ const parseConditionV2 = async ( |
|
|
|
: column.column_name; |
|
|
|
: column.column_name; |
|
|
|
let val = customWhereClause ? customWhereClause : filter.value; |
|
|
|
let val = customWhereClause ? customWhereClause : filter.value; |
|
|
|
|
|
|
|
|
|
|
|
if (column.uidt === UITypes.Formula) { |
|
|
|
|
|
|
|
[field, val] = [val, field]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return qb => { |
|
|
|
return qb => { |
|
|
|
switch (filter.comparison_op) { |
|
|
|
switch (filter.comparison_op) { |
|
|
|
case 'eq': |
|
|
|
case 'eq': |
|
|
@ -224,6 +220,7 @@ const parseConditionV2 = async ( |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'like': |
|
|
|
case 'like': |
|
|
|
if (column.uidt === UITypes.Formula) { |
|
|
|
if (column.uidt === UITypes.Formula) { |
|
|
|
|
|
|
|
[field, val] = [val, field]; |
|
|
|
val = `%${val}%`.replace("%'", '%').replace("'%", '%'); |
|
|
|
val = `%${val}%`.replace("%'", '%').replace("'%", '%'); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
val = `%${val}%`; |
|
|
|
val = `%${val}%`; |
|
|
@ -236,6 +233,7 @@ const parseConditionV2 = async ( |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'nlike': |
|
|
|
case 'nlike': |
|
|
|
if (column.uidt === UITypes.Formula) { |
|
|
|
if (column.uidt === UITypes.Formula) { |
|
|
|
|
|
|
|
[field, val] = [val, field]; |
|
|
|
val = `%${val}%`.replace("%'", '%').replace("'%", '%'); |
|
|
|
val = `%${val}%`.replace("%'", '%').replace("'%", '%'); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
val = `%${val}%`; |
|
|
|
val = `%${val}%`; |
|
|
@ -288,9 +286,15 @@ const parseConditionV2 = async ( |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'empty': |
|
|
|
case 'empty': |
|
|
|
|
|
|
|
if (column.uidt === UITypes.Formula) { |
|
|
|
|
|
|
|
[field, val] = [val, field]; |
|
|
|
|
|
|
|
} |
|
|
|
qb = qb.where(field, val); |
|
|
|
qb = qb.where(field, val); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'notempty': |
|
|
|
case 'notempty': |
|
|
|
|
|
|
|
if (column.uidt === UITypes.Formula) { |
|
|
|
|
|
|
|
[field, val] = [val, field]; |
|
|
|
|
|
|
|
} |
|
|
|
qb = qb.whereNot(field, val); |
|
|
|
qb = qb.whereNot(field, val); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'null': |
|
|
|
case 'null': |
|
|
|