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

Commit e34da0d4 by José Moreira

Join ON after include.where check

1 parent d8389862
Showing with 4 additions and 3 deletions
...@@ -784,9 +784,6 @@ module.exports = (function() { ...@@ -784,9 +784,6 @@ module.exports = (function() {
self.quoteTable(tableRight) + "." + self.quoteIdentifier(attrRight) self.quoteTable(tableRight) + "." + self.quoteIdentifier(attrRight)
) )
// Generate join SQL
joinQueryItem += joinType + self.quoteTable(table, as) + " ON " + joinOn
if (include.where) { if (include.where) {
joinOn += " AND " + self.getWhereConditions(include.where, self.sequelize.literal(self.quoteIdentifier(as)), include.model, whereOptions) joinOn += " AND " + self.getWhereConditions(include.where, self.sequelize.literal(self.quoteIdentifier(as)), include.model, whereOptions)
...@@ -805,6 +802,10 @@ module.exports = (function() { ...@@ -805,6 +802,10 @@ module.exports = (function() {
')', 'IS NOT NULL'].join(' ')) ')', 'IS NOT NULL'].join(' '))
} }
} }
// Generate join SQL
joinQueryItem += joinType + self.quoteTable(table, as) + " ON " + joinOn
} }
if (include.subQuery && subQuery) { if (include.subQuery && subQuery) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!