|
|
|
@ -303,16 +303,20 @@ const parseConditionV2 = async (
|
|
|
|
|
} else { |
|
|
|
|
val = val.startsWith('%') || val.endsWith('%') ? val : `%${val}%`; |
|
|
|
|
} |
|
|
|
|
qb.where((nestedQb) => { |
|
|
|
|
if (qb?.client?.config?.client === 'pg') { |
|
|
|
|
qb = qb.whereRaw('??::text not ilike ?', [field, val]); |
|
|
|
|
nestedQb.whereRaw('??::text not ilike ?', [field, val]); |
|
|
|
|
} else { |
|
|
|
|
qb = qb.whereNot(field, 'like', val); |
|
|
|
|
nestedQb.whereNot(field, 'like', val); |
|
|
|
|
} |
|
|
|
|
nestedQb.orWhereNull(field); |
|
|
|
|
}); |
|
|
|
|
break; |
|
|
|
|
case 'allof': |
|
|
|
|
case 'anyof': |
|
|
|
|
case 'nallof': |
|
|
|
|
case 'nanyof': |
|
|
|
|
{ |
|
|
|
|
// Condition for filter, without negation
|
|
|
|
|
const condition = (builder: Knex.QueryBuilder) => { |
|
|
|
|
const items = val.split(',').map((item) => item.trim()); |
|
|
|
@ -348,6 +352,7 @@ const parseConditionV2 = async (
|
|
|
|
|
} else { |
|
|
|
|
qb = qb.whereNot(condition).orWhereNull(field); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case 'gt': |
|
|
|
|
qb = qb.where(field, customWhereClause ? '<' : '>', val); |
|
|
|
|