dao = new SystemMenuDao(); } /** * @param int $super * @param int $hide * @param int $type * @return array */ public function getMenuList(int $roles = 0,int $hide = 0,int $type = 1): array { $model = new SystemMenu(); try { if($roles>-1){ $systemRoleService = new SystemRoleService(); $rules = $systemRoleService->getColumn(['id'=>$roles],'rules'); $rulesStr = array_unique(explode(',', implode(',', $rules))); $data = $model->where("status",1)->whereIn('id',$rulesStr)->where("from",$type)->order("sort","asc")->select(); }else{ $data = $model->where("status",1)->where("from",$type)->order("sort","asc")->select(); } } catch (\Throwable $throwable) { return []; } return $data->isEmpty()?[]:$data->toArray(); } }