不要怂,就是干,撸起袖子干!

Commit 907426d5 by Mick Hansen

fix(sql/where): only check size for plain objects and arrays

1 parent 7a82da2c
Showing with 3 additions and 1 deletions
......@@ -1661,7 +1661,9 @@ module.exports = (function() {
if (Array.isArray(value)) {
value = value.map(function (item) {
var itemQuery = self.whereItemsQuery(item, options, ' AND ');
if (_.size(item) > 1) itemQuery = '('+itemQuery+')';
if ((Array.isArray(item) || _.isPlainObject(item)) &&_.size(item) > 1) {
itemQuery = '('+itemQuery+')';
}
return itemQuery;
}).filter(function (item) {
return item && item.length;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!