From 77dbc94063ac6926cad144ebe2649560399c84a6 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 28 Feb 2020 17:20:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B8=E6=88=8F=E7=B1=BB=E5=9E=8B-=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 | 2 +- .../Controller/GameTypeController.class.php | 7 +++++ .../Controller/ThinkController.class.php | 27 +++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 194068888..ea4c22104 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -5630,7 +5630,7 @@ class ExportController extends Controller } - + $this->exportAddOperationLog('GameType/lists','游戏-游戏管理-游戏类型-导出'); $this->exportExcel($xlsName, $xlsCell, $xlsData); } diff --git a/Application/Admin/Controller/GameTypeController.class.php b/Application/Admin/Controller/GameTypeController.class.php index 8b6a0f7ab..d74810097 100644 --- a/Application/Admin/Controller/GameTypeController.class.php +++ b/Application/Admin/Controller/GameTypeController.class.php @@ -82,6 +82,13 @@ class GameTypeController extends ThinkController { public function set_status($model="GameType") { + $id = I("ids"); + $key = M("GameType","tab_")->where("id={$id}")->find()['type_name']; + addOperationLog(array( + "op_type"=>1, + "key"=>$key, + "url"=>U("GameType/lists") + )); parent::set_status($model); } } diff --git a/Application/Admin/Controller/ThinkController.class.php b/Application/Admin/Controller/ThinkController.class.php index 098f9e15b..2cb7b27af 100644 --- a/Application/Admin/Controller/ThinkController.class.php +++ b/Application/Admin/Controller/ThinkController.class.php @@ -457,7 +457,19 @@ class ThinkController extends AdminController { $Model = D(get_table_name($model['id'])); $map = array('id' => array('in', $ids) ); + if(CONTROLLER_NAME == "GameType"){ + $yres = $Model->where($map)->select(); + } if($Model->where($map)->delete()){ + if(CONTROLLER_NAME == "GameType"){ + foreach ($yres as $k => $v) { + addOperationLog(array( + "op_type"=>2, + "key"=>$v['type_name'], + "url"=>U("GameType/lists") + )); + } + } $this->success('删除成功',$url); } else { $this->error('删除失败!'); @@ -483,6 +495,13 @@ class ThinkController extends AdminController { $Model = $this->checkAttr($Model,$model['id']); if($Model->create() && $Model->save() !== false){ \Think\Log::actionLog(CONTROLLER_NAME.'/edit',$model,1); + if(CONTROLLER_NAME == "GameType"){ + addOperationLog(array( + "op_type"=>1, + "key"=>$_POST['type_name'], + "url"=>U("GameType/lists") + )); + } $this->success('保存'.$model['title'].'成功!',empty($url)? U('lists?model='.$model['name']):$url); } else { $this->error($Model->getError());//,empty($url)? U('lists?model='.$model['name']):$url @@ -514,6 +533,14 @@ class ThinkController extends AdminController { if($Model->create() && $Model->add()){// \Think\Log::actionLog(CONTROLLER_NAME.'/add',$model,1); + //操作日志 + if(CONTROLLER_NAME == "GameType"){ + addOperationLog(array( + "op_type"=>0, + "key"=>$_POST['type_name'], + "url"=>U("GameType/lists") + )); + } $this->success('添加'.$model['title'].'成功!', empty($url)? U('lists?model='.$model['name']):$url); } else { $this->error($Model->getError());