From fd30f090e40dc25a758d99029fa07f669f575580 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 11 Nov 2016 17:22:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BModel=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/library/think/Model.php b/library/think/Model.php index 8073ca06..aed24f7a 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -1365,19 +1365,10 @@ abstract class Model implements \JsonSerializable, \ArrayAccess public static function __callStatic($method, $params) { - $query = self::getDb(); + $query = (new static())->db(); return call_user_func_array([$query, $method], $params); } - protected static function getDb() - { - $model = get_called_class(); - if (!isset(self::$links[$model])) { - self::$links[$model] = (new static())->db(); - } - return self::$links[$model]; - } - /** * 修改器 设置数据对象的值 * @access public