/** * 得到带有层级的role数据 * @return array */ public function getRoles() { $category = new \Org\Util\Category($this->getModelName(), array('id', 'pid', 'name')); return $category->getList(); }