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

Commit 8ef768dc by oubushixb

findAndCountAll do not support {raw:true} option

fix the problem by add the queryOptions param to findAndCountAll function
1 parent 610a2c43
Showing with 2 additions and 2 deletions
...@@ -545,7 +545,7 @@ module.exports = (function() { ...@@ -545,7 +545,7 @@ module.exports = (function() {
return this.QueryInterface.rawSelect(this.getTableName(), options, 'count') return this.QueryInterface.rawSelect(this.getTableName(), options, 'count')
} }
DAOFactory.prototype.findAndCountAll = function(options) { DAOFactory.prototype.findAndCountAll = function(options, queryOptions) {
var self = this var self = this
// no limit, offset, order, attributes or include for the options given to count() // no limit, offset, order, attributes or include for the options given to count()
, copts = Utils._.omit(options || {}, ['offset', 'limit', 'order', 'include', 'attributes']) , copts = Utils._.omit(options || {}, ['offset', 'limit', 'order', 'include', 'attributes'])
...@@ -574,7 +574,7 @@ module.exports = (function() { ...@@ -574,7 +574,7 @@ module.exports = (function() {
return emit.okay(cnt) // no records, no need for another query return emit.okay(cnt) // no records, no need for another query
} }
self.findAll(options) self.findAll(options, queryOptions)
.on('sql', emit.sql) .on('sql', emit.sql)
.error(emit.err) .error(emit.err)
.success(function(rows) { .success(function(rows) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!