scope方法调整

This commit is contained in:
thinkphp
2016-04-08 18:42:30 +08:00
parent b7bf4dfaba
commit d43f4ed6a8

View File

@@ -617,8 +617,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
// 命名范围 // 命名范围
public static function scope($name) public static function scope($name)
{ {
$model = new static(); $model = new static();
return $model->$name(); $method = 'scope' . $name;
return $model->$method();
} }
// 解析模型的完整命名空间 // 解析模型的完整命名空间