admin_group_acc
This commit is contained in:
parent
bc4e56fd66
commit
1c4078da8f
@ -73,9 +73,9 @@ class Admin extends AdminController
|
|||||||
$data['create_time'] = time();
|
$data['create_time'] = time();
|
||||||
$salt = substr(md5($data['create_time']),-6);
|
$salt = substr(md5($data['create_time']),-6);
|
||||||
$data['password'] = substr_replace(md5($data['password']),$salt,0,6);
|
$data['password'] = substr_replace(md5($data['password']),$salt,0,6);
|
||||||
$result = Db::name('admin')->save($data);
|
$adminId = Db::name('admin')->insertGetId($data);
|
||||||
Db::name('auth_group_access')->save(['uid'=>$data['id'],'group_id'=>$data['auth_group_id']]);
|
Db::name('auth_group_access')->insert(['uid'=>$adminId,'group_id'=>$data['auth_group_id']]);
|
||||||
if($result){
|
if($adminId){
|
||||||
$res = ['code'=>0,'msg'=>'添加成功'];
|
$res = ['code'=>0,'msg'=>'添加成功'];
|
||||||
}else{
|
}else{
|
||||||
$res = ['code'=>-1,'msg'=>'添加失败'];
|
$res = ['code'=>-1,'msg'=>'添加失败'];
|
||||||
@ -88,9 +88,9 @@ class Admin extends AdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
//管理员编辑
|
//管理员编辑
|
||||||
public function edit()
|
public function edit($id)
|
||||||
{
|
{
|
||||||
$admin = AdminModel::find(input('id'));
|
$admin = AdminModel::find($id);
|
||||||
|
|
||||||
if(Request::isAjax()){
|
if(Request::isAjax()){
|
||||||
$data = Request::param();
|
$data = Request::param();
|
||||||
|
Loading…
Reference in New Issue
Block a user