|
|
|
@ -297,11 +297,17 @@ const parseConditionV2 = async (
|
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case 'nlike': |
|
|
|
|
if (!val) { |
|
|
|
|
// val is empty -> include all values but empty strings
|
|
|
|
|
qb.whereNot(field, ''); |
|
|
|
|
qb.orWhereNull(field); |
|
|
|
|
} else { |
|
|
|
|
if (column.uidt === UITypes.Formula) { |
|
|
|
|
[field, val] = [val, field]; |
|
|
|
|
val = `%${val}%`.replace(/^%'([\s\S]*)'%$/, '%$1%'); |
|
|
|
|
} else { |
|
|
|
|
val = val.startsWith('%') || val.endsWith('%') ? val : `%${val}%`; |
|
|
|
|
val = |
|
|
|
|
val.startsWith('%') || val.endsWith('%') ? val : `%${val}%`; |
|
|
|
|
} |
|
|
|
|
qb.where((nestedQb) => { |
|
|
|
|
if (qb?.client?.config?.client === 'pg') { |
|
|
|
@ -309,8 +315,16 @@ const parseConditionV2 = async (
|
|
|
|
|
} else { |
|
|
|
|
nestedQb.whereNot(field, 'like', val); |
|
|
|
|
} |
|
|
|
|
if (val !== '%%') { |
|
|
|
|
// if value is not empty, empty or null should be included
|
|
|
|
|
nestedQb.orWhere(field, ''); |
|
|
|
|
nestedQb.orWhereNull(field); |
|
|
|
|
} else { |
|
|
|
|
// if value is empty, then only null is included
|
|
|
|
|
nestedQb.orWhereNull(field); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case 'allof': |
|
|
|
|
case 'anyof': |
|
|
|
|