From 1c4078da8f9c5c5a030f9b3e5985190817387c22 Mon Sep 17 00:00:00 2001 From: zhao Date: Fri, 21 Feb 2020 13:14:55 +0800 Subject: [PATCH] admin_group_acc --- app/admin/controller/Admin.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/admin/controller/Admin.php b/app/admin/controller/Admin.php index 1a26efc..2aac474 100644 --- a/app/admin/controller/Admin.php +++ b/app/admin/controller/Admin.php @@ -73,9 +73,9 @@ class Admin extends AdminController $data['create_time'] = time(); $salt = substr(md5($data['create_time']),-6); $data['password'] = substr_replace(md5($data['password']),$salt,0,6); - $result = Db::name('admin')->save($data); - Db::name('auth_group_access')->save(['uid'=>$data['id'],'group_id'=>$data['auth_group_id']]); - if($result){ + $adminId = Db::name('admin')->insertGetId($data); + Db::name('auth_group_access')->insert(['uid'=>$adminId,'group_id'=>$data['auth_group_id']]); + if($adminId){ $res = ['code'=>0,'msg'=>'添加成功']; }else{ $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()){ $data = Request::param();