MenuService.php 654 B

12345678910111213141516171819202122232425262728
  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 $hide
  10. * @param int $type
  11. * @return array
  12. */
  13. public function getMenuList(int $super = 0,int $hide = 0,int $type = 1): array
  14. {
  15. $model = new SystemMenu();
  16. try {
  17. $data = $model->where("status",1)->where("from",$type)->order("sort","asc")->select();
  18. } catch (\Throwable $throwable) {
  19. return [];
  20. }
  21. return $data->isEmpty()?[]:$data->toArray();
  22. }
  23. }