From 1a902f92cd87be043814a3f7ebfbec40acb6eb1a Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 13 Dec 2015 10:52:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3model=E7=B1=BB=E7=9A=84cache?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/model.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/think/model.php b/library/think/model.php index f45a60b8..927b5033 100644 --- a/library/think/model.php +++ b/library/think/model.php @@ -459,7 +459,7 @@ class Model if (isset($options['cache'])) { $cache = $options['cache']; $key = is_string($cache['key']) ? $cache['key'] : md5(serialize($options)); - $data = Cache::get($key, '', $cache); + $data = Cache::get($key); if (false !== $data) { return $data; } @@ -493,7 +493,7 @@ class Model } if (isset($cache)) { - Cache::set($key, $resultSet, $cache); + Cache::set($key, $resultSet, $cache['expire']); } return $resultSet; @@ -641,7 +641,7 @@ class Model if (isset($options['cache'])) { $cache = $options['cache']; $key = is_string($cache['key']) ? $cache['key'] : md5(serialize($options)); - $data = Cache::get($key, '', $cache); + $data = Cache::get($key); if (false !== $data) { $this->data = $data; return $data; @@ -663,7 +663,7 @@ class Model // 数据对象赋值 $this->data = $data; if (isset($cache)) { - Cache::set($key, $data, $cache); + Cache::set($key, $data, $cache['expire']); } return $this->data; }