From d43f4ed6a8669af31b09b0fa4e111615a6daf7e8 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 8 Apr 2016 18:42:30 +0800 Subject: [PATCH] =?UTF-8?q?scope=E6=96=B9=E6=B3=95=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/think/Model.php b/library/think/Model.php index 1ef0b2c9..1121261f 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -617,8 +617,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess // 命名范围 public static function scope($name) { - $model = new static(); - return $model->$name(); + $model = new static(); + $method = 'scope' . $name; + return $model->$method(); } // 解析模型的完整命名空间