|
|
@ -476,6 +476,27 @@ const parseConditionV2 = async ( |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case 'lt': |
|
|
|
|
|
|
|
const lt_op = customWhereClause ? '>' : '<'; |
|
|
|
|
|
|
|
qb = qb.where(field, lt_op, val); |
|
|
|
|
|
|
|
if (column.uidt === UITypes.Rating) { |
|
|
|
|
|
|
|
// unset number is considered as NULL
|
|
|
|
|
|
|
|
if (lt_op === '<' && val > 0) { |
|
|
|
|
|
|
|
qb = qb.orWhereNull(field); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 'le': |
|
|
|
|
|
|
|
case 'lte': |
|
|
|
|
|
|
|
const le_op = customWhereClause ? '>=' : '<='; |
|
|
|
|
|
|
|
qb = qb.where(field, le_op, val); |
|
|
|
|
|
|
|
if (column.uidt === UITypes.Rating) { |
|
|
|
|
|
|
|
// unset number is considered as NULL
|
|
|
|
|
|
|
|
if (le_op === '<=' || (le_op === '>=' && val === 0)) { |
|
|
|
|
|
|
|
qb = qb.orWhereNull(field); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
case 'in': |
|
|
|
case 'in': |
|
|
|
qb = qb.whereIn( |
|
|
|
qb = qb.whereIn( |
|
|
|
field, |
|
|
|
field, |
|
|
@ -512,27 +533,6 @@ const parseConditionV2 = async ( |
|
|
|
else if (filter.value === 'false') |
|
|
|
else if (filter.value === 'false') |
|
|
|
qb = qb.whereNot(customWhereClause || field, false); |
|
|
|
qb = qb.whereNot(customWhereClause || field, false); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'lt': |
|
|
|
|
|
|
|
const lt_op = customWhereClause ? '>' : '<'; |
|
|
|
|
|
|
|
qb = qb.where(field, lt_op, val); |
|
|
|
|
|
|
|
if (column.uidt === UITypes.Rating) { |
|
|
|
|
|
|
|
// unset number is considered as NULL
|
|
|
|
|
|
|
|
if (lt_op === '<' && val > 0) { |
|
|
|
|
|
|
|
qb = qb.orWhereNull(field); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 'le': |
|
|
|
|
|
|
|
case 'lte': |
|
|
|
|
|
|
|
const le_op = customWhereClause ? '>=' : '<='; |
|
|
|
|
|
|
|
qb = qb.where(field, le_op, val); |
|
|
|
|
|
|
|
if (column.uidt === UITypes.Rating) { |
|
|
|
|
|
|
|
// unset number is considered as NULL
|
|
|
|
|
|
|
|
if (le_op === '<=' || (le_op === '>=' && val === 0)) { |
|
|
|
|
|
|
|
qb = qb.orWhereNull(field); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 'empty': |
|
|
|
case 'empty': |
|
|
|
if (column.uidt === UITypes.Formula) { |
|
|
|
if (column.uidt === UITypes.Formula) { |
|
|
|
[field, val] = [val, field]; |
|
|
|
[field, val] = [val, field]; |
|
|
|