From e56ccbe8253dfa9f736562664e07c6719e50735c Mon Sep 17 00:00:00 2001 From: welefen Date: Thu, 17 Jul 2014 16:12:35 +0800 Subject: [PATCH] =?UTF-8?q?model=E9=87=8C=E7=9A=84query=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BC=93=E5=AD=98=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Lib/Core/Model.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Lib/Core/Model.js b/lib/Lib/Core/Model.js index 6386df6e..6b4dd68a 100644 --- a/lib/Lib/Core/Model.js +++ b/lib/Lib/Core/Model.js @@ -907,8 +907,11 @@ var Model = module.exports = Class(function(){ } var self = this; return this.parseSql(sql, parse).then(function(sql){ - return self.db.query(sql); - }); + return self.db.select(sql, self._options.cache); + }).then(function(data){ + self._options = {}; + return data; + }) }, /** * 执行SQL语法,非查询类的SQL语句,返回值为影响的行数