render('home'); } /* * 用户管理-用户列表数据 * */ public function actionHomefrom() { $model = new User(); $result = $model->Userlist(); if ($result != false) { return Help::JsonData(0, '成功', $result['count'], $result['data']); } return Help::JsonData(Help::ERROR, '暂无数据'); } /* * 添加用户页面 * */ public function actionAdduser() { return $this->render('adduser'); } /* * 添加用户数据 * */ public function actionAdduserfrom() { $model = new User(); $user = $model->Signup(); if ($user === true) return Help::JsonCode(Help::SUCCESS, '账号添加成功'); return Help::JsonCode(Help::ERROR, '账号添加失败'); } /* * 用户添加角色页面 * */ public function actionAdduserrole() { $model = new User(); $result = $model->UserRoleFilter(); if ($result != false) { return $this->render('adduserrole', ['uid' => Yii::$app->request->get('uid'), 'model' => $result]); } } /* * 2020.6.23 lyy 设置用户状态 * */ public function actionUsersetstatus() { $model = new \backend\server\User(); $result = $model->Usersetstatus(); if ($result === true) return Help::JsonCode(Help::SUCCESS, '设置成功'); return Help::JsonCode(Help::ERROR, '设置失败'); } /* * 用户添加角色 * */ public function actionAdduserrolefrom() { $model = new \backend\server\RoleAuthority(); if ($model->CreateUserRole() === true) { return Help::JsonCode(Help::SUCCESS, '添加成功'); } return Help::JsonCode(Help::ERROR, '添加成功'); } /* * 修改用户界面 * */ public function actionEdit() { $model = new \common\models\User(); $model->uid = Yii::$app->request->get('id'); $userInfo = $model->findUserName(); if ($userInfo != null) return $this->render('edit', ['model' => $userInfo]); } /* * 修改用户数据 * */ public function actionEditform() { $model = new \backend\server\User(); $result = $model->UserSaveForm(); if ($result === true) return Help::JsonCode(Help::SUCCESS, '修改成功'); return Help::JsonCode(Help::ERROR, '修改失败', $result); } /* * 个人密码修改 * */ public function actionPwdsave() { return $this->render('pwdsave'); } /* * 用户密码修改 * */ public function actionPwdsaveform() { $model = new \backend\server\User(); $result = $model->PasswordSave(); if ($result === true) { return Help::JsonCode(Help::SUCCESS, '密码修改成功'); } return Help::JsonCode(Help::ERROR, $result); } }