From 522e6cf8bf93255c9bc902155bab6b9afc853569 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 10 Apr 2016 17:04:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/Model.php b/library/think/Model.php index 54bcd4b4..221f6e90 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -618,7 +618,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess if ($cache) { // 查找是否存在缓存 - $name = basename(str_replace('\\', '/', get_called_class())); + $name = basename(str_replace('\\', '/', static::class)); $guid = md5('model_' . $name . '_' . serialize($data)); $result = Cache::get($guid); if ($result) { @@ -873,7 +873,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess */ protected static function db() { - $model = get_called_class(); + $model = static::class; if (!isset(self::$links[$model])) { self::$links[$model] = Db::connect(static::$connection);