From c9e23e61b644d049d86e048e6969028be0ea4baf Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 16 Apr 2016 21:51:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4Query=E7=B1=BB=E7=9A=84scope?= =?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 | 1 + library/think/db/Query.php | 17 ----------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/library/think/Model.php b/library/think/Model.php index 9d75e591..d945b3bb 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -684,6 +684,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess * 命名范围 * @access public * @param string|Closure $name 命名范围名称 逗号分隔 + * @param mixed $params 参数调用 * @return \think\Model */ public static function scope($name, $params = []) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 9826c08d..35948b93 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -788,23 +788,6 @@ class Query return isset($this->bind[$key]); } - /** - * 调用命名范围 - * @access public - * @param Closure $scope 命名范围 闭包定义 - * @param mixed $args 参数 - * @return $this - */ - public function scope($scope = '', $args = null) - { - if ($scope instanceof \Closure) { - call_user_func_array($scope, [ & $this, $args]); - } elseif ($scope instanceof Query) { - return $scope; - } - return $this; - } - /** * 查询参数赋值 * @access public