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

Commit 09441160 by Jan Aagaard Meier

Merge pull request #2079 from TheBenji/1.7.0

distinct option for count
2 parents 33727829 35a626c0
Showing with 6 additions and 0 deletions
......@@ -614,6 +614,12 @@ module.exports = (function() {
[this.sequelize.fn('COUNT', col), 'count']
]
if(options.distinct) {
options.attributes = [
[this.sequelize.fn('COUNT', this.sequelize.fn('DISTINCT', col) ), 'count']
]
}
options.includeIgnoreAttributes = false
options.limit = null
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!