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

Commit c2257b10 by kevin.xu

switch position for order and group options, cause when order and group both provided, sql broken

1 parent 3f3a797b
Showing with 5 additions and 4 deletions
...@@ -178,15 +178,16 @@ module.exports = (function() { ...@@ -178,15 +178,16 @@ module.exports = (function() {
query += " WHERE <%= where %>" query += " WHERE <%= where %>"
} }
if(options.order) {
query += " ORDER BY <%= order %>"
}
if(options.group) { if(options.group) {
options.group = Utils.addTicks(options.group) options.group = Utils.addTicks(options.group)
query += " GROUP BY <%= group %>" query += " GROUP BY <%= group %>"
} }
if(options.order) {
query += " ORDER BY <%= order %>"
}
if(options.limit && !(options.include && (options.limit === 1))) { if(options.limit && !(options.include && (options.limit === 1))) {
if(options.offset) { if(options.offset) {
query += " LIMIT <%= offset %>, <%= limit %>" query += " LIMIT <%= offset %>, <%= limit %>"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!