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

Commit 8fb8bbc2 by Elliot Foster

Scope 'smart' variable correctly

1 parent d5c66c39
...@@ -61,6 +61,7 @@ module.exports = (function() { ...@@ -61,6 +61,7 @@ module.exports = (function() {
} }
if (options.where) { if (options.where) {
var smart
if (Array.isArray(options.where)) { if (Array.isArray(options.where)) {
smart = Utils.smartWhere([where, options.where], self.__factory.target.daoFactoryManager.sequelize.options.dialect) smart = Utils.smartWhere([where, options.where], self.__factory.target.daoFactoryManager.sequelize.options.dialect)
smart = Utils.compileSmartWhere.call(self.__factory.target, smart, self.__factory.target.daoFactoryManager.sequelize.options.dialect) smart = Utils.compileSmartWhere.call(self.__factory.target, smart, self.__factory.target.daoFactoryManager.sequelize.options.dialect)
......
...@@ -16,7 +16,7 @@ module.exports = (function() { ...@@ -16,7 +16,7 @@ module.exports = (function() {
where[this.__factory.identifier] = this.instance[primaryKey] where[this.__factory.identifier] = this.instance[primaryKey]
if (options.where) { if (options.where) {
smart = Utils.smartWhere([where, options.where], this.__factory.target.daoFactoryManager.sequelize.options.dialect) var smart = Utils.smartWhere([where, options.where], this.__factory.target.daoFactoryManager.sequelize.options.dialect)
smart = Utils.compileSmartWhere.call(this.__factory.target, smart, this.__factory.target.daoFactoryManager.sequelize.options.dialect) smart = Utils.compileSmartWhere.call(this.__factory.target, smart, this.__factory.target.daoFactoryManager.sequelize.options.dialect)
if (smart.length > 0) { if (smart.length > 0) {
options.where = smart options.where = smart
......
...@@ -62,7 +62,7 @@ module.exports = (function() { ...@@ -62,7 +62,7 @@ module.exports = (function() {
params = {where: where} params = {where: where}
} }
smart = Utils.smartWhere(params.where || [], self.target.daoFactoryManager.sequelize.options.dialect) var smart = Utils.smartWhere(params.where || [], self.target.daoFactoryManager.sequelize.options.dialect)
smart = Utils.compileSmartWhere.call(self.target, smart, self.target.daoFactoryManager.sequelize.options.dialect) smart = Utils.compileSmartWhere.call(self.target, smart, self.target.daoFactoryManager.sequelize.options.dialect)
if (smart.length > 0) { if (smart.length > 0) {
params.where = smart params.where = smart
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!