/** * 编辑角色 */ public function actionEdit() { $funcData = $this->getFuncsData(); $role_id = $this->helpGquery('role_id'); $role = Roles::getById($role_id); $role_func_list = Role_Purview::getByRoleId($role_id); $role_func_data = []; foreach ($role_func_list as $k => $v) { $func_id = $v['func_id']; $role_func_data[$func_id] = $v; } $data = array('role' => $role, 'funcData' => $funcData, 'role_func_data' => $role_func_data); return $this->render('edit', $data); }