mirror of
https://github.com/thinkjs/thinkjs.git
synced 2026-01-25 14:42:47 +00:00
model里的query方法增加缓存的功能
This commit is contained in:
parent
cd2dfeb6c8
commit
e56ccbe825
@ -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语句,返回值为影响的行数
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user