|
@@ -60,6 +60,10 @@ class Admin extends Backend
|
|
|
}
|
|
|
|
|
|
$this->view->assign('groupdata', $groupdata);
|
|
|
+ //公会
|
|
|
+ $gh = Db::name('gonghui')->order('id asc')->column('id,name');
|
|
|
+ $this->assign('gh',$gh);
|
|
|
+ //公会
|
|
|
$this->assignconfig("admin", ['id' => $this->auth->id]);
|
|
|
}
|
|
|
|
|
@@ -131,6 +135,10 @@ class Admin extends Backend
|
|
|
$params['salt'] = Random::alnum();
|
|
|
$params['password'] = md5(md5($params['password']) . $params['salt']);
|
|
|
$params['avatar'] = '/assets/img/avatar.png'; //设置新管理员默认头像。
|
|
|
+ //公会
|
|
|
+ $gh = $this->request->post("gh/a");
|
|
|
+ $params['gh_ids'] = implode(',',$gh);
|
|
|
+ //公会
|
|
|
$result = $this->model->validate('Admin.add')->save($params);
|
|
|
if ($result === false) {
|
|
|
exception($this->model->getError());
|
|
@@ -187,6 +195,12 @@ class Admin extends Backend
|
|
|
} else {
|
|
|
unset($params['password'], $params['salt']);
|
|
|
}
|
|
|
+
|
|
|
+ //公会
|
|
|
+ $gh = $this->request->post("gh/a");
|
|
|
+ $params['gh_ids'] = implode(',',$gh);
|
|
|
+ //公会
|
|
|
+
|
|
|
//这里需要针对username和email做唯一验证
|
|
|
$adminValidate = \think\Loader::validate('Admin');
|
|
|
$adminValidate->rule([
|
|
@@ -231,6 +245,10 @@ class Admin extends Backend
|
|
|
}
|
|
|
$this->view->assign("row", $row);
|
|
|
$this->view->assign("groupids", $groupids);
|
|
|
+ //公会
|
|
|
+ $gh_ids = explode(',',$row['gh_ids']);
|
|
|
+ $this->assign("gh_ids", $gh_ids);
|
|
|
+ //公会
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
|