mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
修正查询范围
This commit is contained in:
@@ -1484,7 +1484,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
}
|
}
|
||||||
$model = new static();
|
$model = new static();
|
||||||
$params = func_get_args();
|
$params = func_get_args();
|
||||||
$params[0] = $model->db();
|
$params[0] = $model->getQuery();
|
||||||
if ($name instanceof \Closure) {
|
if ($name instanceof \Closure) {
|
||||||
call_user_func_array($name, $params);
|
call_user_func_array($name, $params);
|
||||||
} elseif (is_string($name)) {
|
} elseif (is_string($name)) {
|
||||||
@@ -1510,7 +1510,6 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
public static function useGlobalScope($use)
|
public static function useGlobalScope($use)
|
||||||
{
|
{
|
||||||
$model = new static();
|
$model = new static();
|
||||||
static::$db = $model->db($use);
|
|
||||||
return $model;
|
return $model;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1886,7 +1885,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
public static function __callStatic($method, $args)
|
public static function __callStatic($method, $args)
|
||||||
{
|
{
|
||||||
$model = new static();
|
$model = new static();
|
||||||
$query = $model->db();
|
$query = $model->db(true, false);
|
||||||
|
|
||||||
if (method_exists($model, 'scope' . $method)) {
|
if (method_exists($model, 'scope' . $method)) {
|
||||||
// 动态调用命名范围
|
// 动态调用命名范围
|
||||||
|
|||||||
Reference in New Issue
Block a user