refactor(admin): 重构控制器和模型的使用方式

- https://github.com/top-think/think-orm/issues/704
This commit is contained in:
wolfcode
2025-03-27 18:38:27 +08:00
parent bc03616e43
commit b9f764e4d0
19 changed files with 96 additions and 109 deletions

View File

@@ -7,13 +7,13 @@ use app\common\model\TimeModel;
class SystemNode extends TimeModel
{
public function getNodeTreeList(): array
public static function getNodeTreeList(): array
{
$list = $this->removeOption()->select()->toArray();
return $this->buildNodeTree($list);
$list = self::select()->toArray();
return self::buildNodeTree($list);
}
protected function buildNodeTree($list): array
protected static function buildNodeTree($list): array
{
$newList = [];
$repeatString = "      ";