MenuService.php 686 B

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