|
|
@ -495,7 +495,7 @@ const parseConditionV2 = async ( |
|
|
|
if (qb?.client?.config?.client === 'pg') { |
|
|
|
if (qb?.client?.config?.client === 'pg') { |
|
|
|
qb = qb.where(knex.raw(`(${finalStatement}) ilike ?`, [val])); |
|
|
|
qb = qb.where(knex.raw(`(${finalStatement}) ilike ?`, [val])); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
qb = qb.where(finalStatement, 'like', val); |
|
|
|
qb = qb.where(knex.raw(`(${finalStatement}) like ?`, [val])); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (!val) { |
|
|
|
if (!val) { |
|
|
@ -507,11 +507,13 @@ const parseConditionV2 = async ( |
|
|
|
|
|
|
|
|
|
|
|
qb.where((nestedQb) => { |
|
|
|
qb.where((nestedQb) => { |
|
|
|
if (qb?.client?.config?.client === 'pg') { |
|
|
|
if (qb?.client?.config?.client === 'pg') { |
|
|
|
nestedQb.where( |
|
|
|
nestedQb.whereNot( |
|
|
|
knex.raw(`(${finalStatement}) not ilike ?`, [val]), |
|
|
|
knex.raw(`(${finalStatement}) ilike ?`, [val]), |
|
|
|
); |
|
|
|
); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
nestedQb.whereNot(finalStatement, 'like', val); |
|
|
|
nestedQb.whereNot( |
|
|
|
|
|
|
|
knex.raw(`(${finalStatement}) like ?`, [val]), |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
if (val !== '%%') { |
|
|
|
if (val !== '%%') { |
|
|
|
// if value is not empty, empty or null should be included
|
|
|
|
// if value is not empty, empty or null should be included
|
|
|
|