From 7141e3752e431613a5ea90e1f533cf2f709213a3 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 26 Feb 2020 09:47:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=93=8D=E4=BD=9C=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=9F=BA=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 29 ++++++++++++------- .../Controller/MemberController.class.php | 2 +- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index b872ae27c..203ffbb1f 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2204,7 +2204,8 @@ function a_array_unique($array){ * op_type=>操作类型 1:编辑 2:删除 3:下载, * op_name=>操作说明 例如:编辑,删除,锁定等, * url=>需要跳转的url 添加去列表加唯一id,编辑直接去编辑页面,下载可以重新下载(新开页面), - * key=>关键词:用户的账号,游戏的名词等 + * key=>关键词:用户的账号,游戏的名词等, + * menu=>非必须,菜单目录,不存在的话按控制器寻找 * ) */ function addOperationLog($options) @@ -2229,18 +2230,24 @@ function a_array_unique($array){ 'key'=>$options['key'], 'create_time'=>time() ]; - //获取菜单名词 - $act = CONTROLLER_NAME.'/'.ACTION_NAME; - $arr = []; - $menuname = D("menu")->field('title,pid,group')->where("url = '{$act}'")->find(); - if($menuname){ - $arr[] = $menuname['title']; - if(!empty($menuname['group'])){ - $arr[] = $menuname['group']; + //获取菜单名称 + if(!array_key_exists("menu",$options)){ + $act = CONTROLLER_NAME.'/'.ACTION_NAME; + $arr = []; + $menuname = D("menu")->field('title,pid,group')->where("url = '{$act}'")->find(); + if($menuname){ + $arr[] = $menuname['title']; + if(!empty($menuname['group'])){ + $arr[] = $menuname['group']; + } + getLink($menuname['pid'],$arr); } - getLink($menuname['pid'],$arr); + $addarray['menu'] = implode ( "-",array_reverse($arr)); + }else{ + $addarray['menu'] = $options['menu']; } - $addarray['menu'] = implode ( "-",array_reverse($arr)); + + M("OperationLog","tab_")->add($addarray); } diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index 893eaa0b7..8a29827ac 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -210,7 +210,7 @@ class MemberController extends ThinkController unset($_GET['export']); addOperationLog(array( "op_type"=>3, - "key"=>date("YmdHis",time()), + "key"=>getNowDate(), "url"=>U("Member/user_info",$_GET), )); data2csv($data,"玩家_玩家列表",$field);