From 3a9575c602861cb53e5042a8d13ef75cb159710a Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 26 Feb 2020 16:26:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=88=A0=E6=94=B9=E5=AF=BC=E5=87=BA-=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/ExportController.class.php | 5 ++-- .../Admin/Controller/UserController.class.php | 26 +++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 347a6aaee..f4a9b235d 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -4794,9 +4794,10 @@ class ExportController extends Controller } - + $GetData = $_GET; + unset($GetData['xlsname']); + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U('User/index',$GetData),'menu'=>'用户-管理组-管理员列表-导出']); $this->exportExcel($xlsName, $xlsCell, $xlsData); - } diff --git a/Application/Admin/Controller/UserController.class.php b/Application/Admin/Controller/UserController.class.php index 09f8ecd63..f91a9cdcc 100644 --- a/Application/Admin/Controller/UserController.class.php +++ b/Application/Admin/Controller/UserController.class.php @@ -211,6 +211,13 @@ class UserController extends AdminController $res = M('UcenterMember')->where($map1)->setField('status', $status); $res1 = M('Member')->where($map)->setField('status', $status); if ($res && $res1) { + $nickname = M('Member')->where($map)->field("nickname")->find()['nickname'];//默认一个,多个时需要遍历 + addOperationLog(array( + "op_type"=>1, + "key"=> $nickname, + "menu"=>"用户-管理组-管理员列表-锁定/解锁", + "url"=>U("User/index",array("nickname"=>$nickname)) + )); $this->success('更新成功!'); } else { $this->error('更新失败!'); @@ -283,6 +290,13 @@ class UserController extends AdminController if (!M('Member')->add($user)) { $this->error('用户添加失败!'); } else { + //操作日志 + addOperationLog(array( + "op_type"=>0, + "key"=>$username, + "url"=>U("User/index",array("nickname"=>$username)) + )); + \Think\Log::actionLog('User/add', 'Member', $uid); $this->success('用户添加成功!', U('index')); } @@ -399,6 +413,12 @@ class UserController extends AdminController if ($smember !== false || $meb || $ag) { M('user_pwd')->where($maps)->setField('password', think_encrypt($info['password'])); + addOperationLog(array( + "op_type"=>1, + "key"=>$_POST['username'], + "url"=>U("User/index",array("nickname"=>$_POST['username'])) + )); + $this->success('修改成功!', U('User/index')); } else { $this->error('修改失败!', U('User/index')); @@ -604,11 +624,17 @@ class UserController extends AdminController public function delete($id) { M()->startTrans(); + $nickname = M('Member')->where("uid = '{$id}'")->field("nickname")->find()['nickname']; $res1 = M('member')->delete($id); $res2 = M('ucenter_member')->delete($id); $res3 = M('auth_group_access')->where(array('uid' => $id))->delete(); if ($res1 && $res2 && $res3) { M()->commit(); + addOperationLog(array( + "op_type"=>2, + "key"=> $nickname, + "url"=>U("User/index") + )); $this->success('删除成功'); } else { M()->rollback();