where($map)->find(); } public function getNodeList($map){ return $this->where($map)->order('sort asc')->select(); } public function getModuleList(){ $map['level'] = DBCont::LEVEL_MODULE; $map['status'] = DBCont::NORMAL_STATUS; return $this->getList($map); } public function isExistsNode($module, $controller, $node){ $map['name'] = $module; $map['status'] = DBCont::NORMAL_STATUS; $map['level'] = DBCont::LEVEL_MODULE; $module_ent = $this->getNode($map); if(!$module_ent){ return false; } $c_map['name'] = $controller; $c_map['status'] = DBCont::NORMAL_STATUS; $c_map['level'] = DBCont::LEVEL_CONTROLLER; $c_map['pid'] = $module_ent['id']; $controller_ent = $this->getNode($c_map); if(!$controller_ent){ return false; } $n_map['name'] = $node; $n_map['status'] = DBCont::NORMAL_STATUS; $n_map['level'] = DBCont::LEVEL_ACTION; $n_map['pid'] = $controller_ent['id']; $node_ent = $this->getNode($n_map); if(!$node_ent){ return false; } return true; } public function getNodeName($module, $controller, $node){ $map['name'] = $module; $map['level'] = DBCont::LEVEL_MODULE; $module_ent = $this->getNode($map); if(!$module_ent){ return ''; } $c_map['name'] = $controller; $c_map['level'] = DBCont::LEVEL_CONTROLLER; $c_map['pid'] = $module_ent['id']; $controller_ent = $this->getNode($c_map); if(!$controller_ent){ return ''; } $n_map['name'] = $node; $n_map['level'] = DBCont::LEVEL_ACTION; $n_map['pid'] = $controller_ent['id']; $node_ent = $this->getNode($n_map); if(!$node_ent){ return ''; } return $node_ent['title']; } }