refactor(admin): 重构控制器和模型的使用方式
- https://github.com/top-think/think-orm/issues/704
This commit is contained in:
@@ -22,15 +22,15 @@ class SystemAdmin extends TimeModel
|
||||
],
|
||||
];
|
||||
|
||||
public function getAuthIdsAttr($value): array
|
||||
public static function getAuthIdsAttr($value): array
|
||||
{
|
||||
if (!$value) return [];
|
||||
return explode(',', $value);
|
||||
}
|
||||
|
||||
public function getAuthList(): array
|
||||
public static function getAuthList(): array
|
||||
{
|
||||
return (new SystemAuth())->removeOption()->where('status', 1)->column('title', 'id');
|
||||
return SystemAuth::where('status', 1)->column('title', 'id');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user