MenuService.php 577 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\service\system;
  3. use app\model\system\SystemMenu;
  4. class MenuService
  5. {
  6. /**
  7. * @param int $super
  8. * @param int $hide
  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. }