|
|
|
@ -285,7 +285,7 @@ const parseConditionV2 = async (
|
|
|
|
|
[field, val] = [val, field]; |
|
|
|
|
val = `%${val}%`.replace(/^%'([\s\S]*)'%$/, '%$1%'); |
|
|
|
|
} else { |
|
|
|
|
val = `%${val}%`; |
|
|
|
|
val = val.startsWith('%') || val.endsWith('%') ? val : `%${val}%`; |
|
|
|
|
} |
|
|
|
|
if (qb?.client?.config?.client === 'pg') { |
|
|
|
|
qb = qb.whereRaw('??::text ilike ?', [field, val]); |
|
|
|
@ -298,7 +298,7 @@ const parseConditionV2 = async (
|
|
|
|
|
[field, val] = [val, field]; |
|
|
|
|
val = `%${val}%`.replace(/^%'([\s\S]*)'%$/, '%$1%'); |
|
|
|
|
} else { |
|
|
|
|
val = `%${val}%`; |
|
|
|
|
val = val.startsWith('%') || val.endsWith('%') ? val : `%${val}%`; |
|
|
|
|
} |
|
|
|
|
qb = qb.whereNot( |
|
|
|
|
field, |
|
|
|
|