mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 20:52:48 +08:00
删除Query类的scope方法
This commit is contained in:
@@ -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 = [])
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user