MenuService.php 629 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace app\extra\service\system;
  3. use app\extra\basic\Service;
  4. use app\model\system\SystemMenu;
  5. class MenuService extends Service
  6. {
  7. /**
  8. * @param int $super
  9. * @param int $type
  10. * @return array
  11. */
  12. public function getMenuList(int $super = 0,int $hide = 0,int $type = 1): array
  13. {
  14. $model = new SystemMenu();
  15. try {
  16. $data = $model->where("status",1)->where("from",$type)->order("sort","asc")->select();
  17. } catch (\Throwable $throwable) {
  18. return [];
  19. }
  20. return $data->isEmpty()?[]:$data->toArray();
  21. }
  22. }