Fix condition with int instead of string

This commit is contained in:
Jim LAURIE 2019-02-05 12:17:27 +01:00 committed by GitHub
parent cd729ec0da
commit f015d7bb2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@ module.exports = {
_.forEach(params.where, (where, key) => {
if (_.isArray(where.value) && where.symbol !== 'IN') {
for (const value in where.value) {
qb[value === 0 ? 'where' : 'orWhere'](key, where.symbol, where.value[value]);
qb[parseInt(value) ? 'orWhere' : 'where'](key, where.symbol, where.value[value]);
}
} else {
qb.where(key, where.symbol, where.value);