From f8aaa88ecdc8e9ccf26d4ddb6d3777edc77e9b94 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 22 Sep 2016 13:38:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Model=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/think/Model.php b/library/think/Model.php index 8a263866..fd3f4ead 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -1347,8 +1347,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess public static function __callStatic($method, $params) { $query = self::getDb(); + $model = get_called_class(); // 全局作用域 - if (static::$useGlobalScope && method_exists(__CLASS__, 'base')) { + if (static::$useGlobalScope && method_exists($model, 'base')) { call_user_func_array('static::base', [ & $query]); } return call_user_func_array([$query, $method], $params);