Model类增加scope方法

This commit is contained in:
thinkphp
2016-04-08 18:41:06 +08:00
parent da9c41f9e7
commit b7bf4dfaba

View File

@@ -614,6 +614,13 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
return $result;
}
// 命名范围
public static function scope($name)
{
$model = new static();
return $model->$name();
}
// 解析模型的完整命名空间
protected function parseModel($model)
{