/** * 变更角色 - 页面 * * @return \Illuminate\View\View */ public function role_get() { $account_info = $this->account_info(); $account_info['page_title'] = '变更角色'; $account_info['page_description'] = ''; if (!isset($_GET['user_id']) || $_GET['user_id'] <= 0) { // dump('无法获取用户信息'); return redirect($this->pre_web_page_url()); } $user = Sentinel::findById($_GET['user_id']); if (!$user) { // dump('无法获取用户信息'); return redirect($this->pre_web_page_url()); } $role = $this->role_by_user($user); $roles = Role::get(); foreach ($roles as $k => $kValue) { $roles[$k]['value'] = 0; if ($kValue['id'] == $role['id']) { $roles[$k]['value'] = 1; } } $account_info['user'] = $user; $account_info['roles'] = $roles; return view('role.role', $account_info); }
private function exist($id) { $this->row = $this->model->get($id); if (!$this->row) { $this->flashMessage($this->translator->translate('admin.role.roleNotFound'), 'error'); $this->redirect('default'); } }
/** * 新增帐户 - 页面 * * @return \Illuminate\View\View */ public function add_get() { $account_info = $this->account_info(); $account_info['page_title'] = '新增账户'; $account_info['page_description'] = ''; $account_info['roles'] = Role::get(); return view('account.add', $account_info); }