From 6dfb13e4d9bb993762e1ace050c36a480c9f0a68 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 25 Feb 2020 17:05:53 +0800 Subject: [PATCH 01/30] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/AdminController.class.php | 59 +++++++++++++++++++ .../Controller/MemberController.class.php | 16 ++++- .../OperationLogController.class.php | 25 ++++++++ Data/update.sql | 15 +++++ 4 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 Application/Admin/Controller/OperationLogController.class.php diff --git a/Application/Admin/Controller/AdminController.class.php b/Application/Admin/Controller/AdminController.class.php index c3e303e15..3c55719ff 100644 --- a/Application/Admin/Controller/AdminController.class.php +++ b/Application/Admin/Controller/AdminController.class.php @@ -662,5 +662,64 @@ class AdminController extends Controller { } } } + /** + * 操作日志 + * array( + * op_type=>操作类型 1:编辑 2:删除 3:下载, + * op_name=>操作说明 例如:编辑,删除,锁定等, + * url=>需要跳转的url 添加去列表加唯一id,编辑直接去编辑页面,下载可以重新下载(新开页面), + * key=>关键词:用户的账号,游戏的名词等 + * ) + */ + public function addOperationLog($options) + { + $checkarr = ['op_type','op_name','url','key']; + foreach ($checkarr as $v) { + if(!array_key_exists($v,$options)){ + $this->error('操作日志添加,参数错误'); + } + } + //获取ip + $addarray = [ + "op_ip"=>$_SERVER['REMOTE_ADDR'], + 'admin_id'=>$_SESSION['onethink_admin']['user_auth']['uid'], + 'admin_account'=>$_SESSION['onethink_admin']['user_auth']['username'], + 'op_type'=>$options['op_type'], + 'op_name'=>$options['op_name'], + 'url'=>$options['url'], + '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']; + } + $this-> getLink($menuname['pid'],$arr); + } + $addarray['menu'] = implode ( "-",array_reverse($arr)); + M("OperationLog","tab_")->add($addarray); + } + public function getLink($pid=0,&$arr){ + if($pid == 0){ + return; + } + $menuname = D("menu")->field('title,pid,group')->where("id = '{$pid}'")->find(); + if($menuname){ + $arr[] = $menuname['title']; + if(!empty($menuname['group'])){ + $arr[] = $menuname['group']; + } + if($menuname['pid'] != 0){ + $this->getLink($menuname['pid'], $arr); + + } + } + + } } diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index e297cb8f3..8adfd8715 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -9,10 +9,10 @@ use Org\WeixinSDK\Weixin; class MemberController extends ThinkController { + /** *玩家列表信息 */ - public function user_info($p=0){ //设定默认时间 // if(!array_key_exists("time_start",$_REQUEST) && I('type') != 2){ @@ -806,6 +806,14 @@ class MemberController extends ThinkController $res = $member->updateInfo($data); if ($res !== false) { \Think\Log::actionLog("Member/edit", "Member", $id); + //操作日志 + $this->addOperationLog(array( + "op_type"=>1, + "op_name"=>"编辑用户信息", + "key"=>$this->getUserAccount($id), + "url"=>U("Member/user_info",array("user_id"=>$id)) + )); + $this->success("修改成功", U('user_info')); } else { $this->error("修改失败"); @@ -1686,4 +1694,10 @@ class MemberController extends ThinkController return $this->success("解除成功"); } } + //获取用户账号 + public function getUserAccount($id) + { + return M("User","tab_")->field("account")->where("id='{$id}'")->find()['account']; + # code... + } } \ No newline at end of file diff --git a/Application/Admin/Controller/OperationLogController.class.php b/Application/Admin/Controller/OperationLogController.class.php new file mode 100644 index 000000000..2ff5f99c8 --- /dev/null +++ b/Application/Admin/Controller/OperationLogController.class.php @@ -0,0 +1,25 @@ +addOperationLog(array( + "op_type"=>1, + "op_name"=>"添加用户", + "key"=>"test185", + "url"=>U("Member/user_info",array("user_id"=>252315)) + )); + } + + + +} diff --git a/Data/update.sql b/Data/update.sql index 4ecdaa17f..dc798d286 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1357,3 +1357,18 @@ ADD COLUMN `verify_status` tinyint(2) NULL DEFAULT 0 COMMENT '审核状态 0:未 -- 支付类型添加易宝支付 INSERT INTO `platform`.`tab_tool`( `name`, `title`, `config`, `template`, `type`, `status`, `create_time`) VALUES ('yeepay', '易宝支付', '', '', 1, 1, 0); + +-- 2020-02-25 chenzhi 后台操作日志 +CREATE TABLE `tab_operation_log` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `op_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '操作类型 1 编辑 2 删除 3下载', + `op_name` varchar(100) COLLATE utf8mb4_bin NOT NULL DEFAULT '0' COMMENT '操作名词', + `url` varchar(1000) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '跳转URL', + `menu` varchar(300) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '菜单目录', + `key` varchar(300) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '关键字唯一表示', + `admin_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作员id', + `admin_account` varchar(30) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '管理员账号', + `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `op_ip` varchar(16) DEFAULT '0' COMMENT '登陆ip', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; \ No newline at end of file From 80f8eb431cdd5276bf6e8d7b5420a7a3bd2e121b Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 25 Feb 2020 17:48:07 +0800 Subject: [PATCH 02/30] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=BB=93=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/AdminController.class.php | 5 +++- .../Controller/MemberController.class.php | 25 ++++++++++++------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Application/Admin/Controller/AdminController.class.php b/Application/Admin/Controller/AdminController.class.php index 3c55719ff..7f4eadbc3 100644 --- a/Application/Admin/Controller/AdminController.class.php +++ b/Application/Admin/Controller/AdminController.class.php @@ -673,12 +673,15 @@ class AdminController extends Controller { */ public function addOperationLog($options) { - $checkarr = ['op_type','op_name','url','key']; + $checkarr = ['op_type','url','key']; foreach ($checkarr as $v) { if(!array_key_exists($v,$options)){ $this->error('操作日志添加,参数错误'); } } + if(!array_key_exists("op_name",$options)){ + $options['op_name'] = ($options['op_type'] == 1 ? "编辑" : ($options['op_type'] == 2 ? "删除" :"下载")); + } //获取ip $addarray = [ "op_ip"=>$_SERVER['REMOTE_ADDR'], diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index 8adfd8715..8c0094779 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -807,12 +807,7 @@ class MemberController extends ThinkController if ($res !== false) { \Think\Log::actionLog("Member/edit", "Member", $id); //操作日志 - $this->addOperationLog(array( - "op_type"=>1, - "op_name"=>"编辑用户信息", - "key"=>$this->getUserAccount($id), - "url"=>U("Member/user_info",array("user_id"=>$id)) - )); + $this->userEditOperationLog($id); $this->success("修改成功", U('user_info')); } else { @@ -1019,6 +1014,7 @@ class MemberController extends ThinkController ->where($map) ->setField('phone', $_POST['phone']); if ($pro !== false) { + $this->userEditOperationLog($user['id']); $this->ajaxReturn(array("status" => 1, "msg" => "手机修改成功")); } else { $this->ajaxReturn(array("status" => 0, "msg" => "手机修改失败")); @@ -1038,6 +1034,7 @@ class MemberController extends ThinkController ->where($map) ->setField('real_name', $_POST['real_name']); if ($pro !== false) { + $this->userEditOperationLog($_POST['id']); $this->ajaxReturn(array("status" => 1, "msg" => "真实姓名修改成功")); } else { $this->ajaxReturn(array("status" => 0, "msg" => "真实姓名修改失败")); @@ -1063,6 +1060,7 @@ class MemberController extends ThinkController ->where($map) ->setField('idcard', $_POST['idcard']); if ($pro !== false) { + $this->userEditOperationLog($_POST['id']); $this->ajaxReturn(array("status" => 1, "msg" => "身份证号码修改成功")); } else { $this->ajaxReturn(array("status" => 0, "msg" => "身份证号码修改失败")); @@ -1248,6 +1246,8 @@ class MemberController extends ThinkController foreach ($users as $item) { \Think\Log::actionLog('Member/lock_status', 'Member', $item['id']); } + $this->userEditOperationLog($id,"锁定/解锁"); + $this->success('操作成功!'); } else { $this->error('操作失败!'); @@ -1694,10 +1694,17 @@ class MemberController extends ThinkController return $this->success("解除成功"); } } - //获取用户账号 - public function getUserAccount($id) + public function userEditOperationLog($id,$op_name = false) { - return M("User","tab_")->field("account")->where("id='{$id}'")->find()['account']; + $option = array( + "op_type"=>1, + "key"=>get_user_account($id), + "url"=>U("Member/edit",array("id"=>$id)) + ); + if($op_name){ + $option['op_name'] = $op_name; + } + $this->addOperationLog($option); # code... } } \ No newline at end of file From bd53d01a0e7801cdc9b0c25bebc463a3f5e25034 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 25 Feb 2020 17:54:45 +0800 Subject: [PATCH 03/30] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/MemberController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index 8c0094779..66fd1c827 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -1014,7 +1014,7 @@ class MemberController extends ThinkController ->where($map) ->setField('phone', $_POST['phone']); if ($pro !== false) { - $this->userEditOperationLog($user['id']); + $this->userEditOperationLog($_POST['id']); $this->ajaxReturn(array("status" => 1, "msg" => "手机修改成功")); } else { $this->ajaxReturn(array("status" => 0, "msg" => "手机修改失败")); From d2867b463517a0b977fe2bfa4bc79d5c4e7aa9c4 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Tue, 25 Feb 2020 17:56:19 +0800 Subject: [PATCH 04/30] =?UTF-8?q?=E8=A1=8C=E4=B8=BA=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/AdminController.class.php | 27 +- .../UserActionLogController.class.php | 299 ++++++++++++++++++ .../Admin/View/UserActionLog/index.html | 239 ++++++++++++++ .../Admin/View/UserActionLog/operateLog.html | 239 ++++++++++++++ 4 files changed, 791 insertions(+), 13 deletions(-) create mode 100644 Application/Admin/Controller/UserActionLogController.class.php create mode 100644 Application/Admin/View/UserActionLog/index.html create mode 100644 Application/Admin/View/UserActionLog/operateLog.html diff --git a/Application/Admin/Controller/AdminController.class.php b/Application/Admin/Controller/AdminController.class.php index 7f4eadbc3..2e050f266 100644 --- a/Application/Admin/Controller/AdminController.class.php +++ b/Application/Admin/Controller/AdminController.class.php @@ -60,19 +60,20 @@ class AdminController extends Controller { if ($rule == "admin/index/index"){ //如果首页没有访问权限 自动检测有访问权限的页面然后跳转过去 - $qx = M("Auth_group")->table("__AUTH_GROUP__ as ag") - ->join("__AUTH_GROUP_ACCESS__ as aga on(ag.id=aga.group_id and aga.uid=".UID.")",'right') - ->where("ag.status=1")->limit(1)->select(); - if (empty($qx)){ - //如果没有任何权限 直接登出 - D('Member')->logout(); - session('[destroy]'); - } - $where['id'] = substr($qx[0]['rules'],0,strpos($qx[0]['rules'], ',')); - //$where['id'] = substr($qx[0]['rules'],0,1) - $dz = M("auth_rule")->field('name')->where($where)->find(); - $red = substr($dz['name'],6); - redirect(U("$red")); +// $qx = M("Auth_group")->table("__AUTH_GROUP__ as ag") +// ->join("__AUTH_GROUP_ACCESS__ as aga on(ag.id=aga.group_id and aga.uid=".UID.")",'right') +// ->where("ag.status=1")->limit(1)->select(); +// if (empty($qx)){ +// //如果没有任何权限 直接登出 +// D('Member')->logout(); +// session('[destroy]'); +// } +// $where['id'] = substr($qx[0]['rules'],0,strpos($qx[0]['rules'], ',')); +// //$where['id'] = substr($qx[0]['rules'],0,1) +// $dz = M("auth_rule")->field('name')->where($where)->find(); +// $red = substr($dz['name'],6); +// redirect(U("$red")); + redirect(U("Admin/Member/user_info")); }else{ $this->error('未授权访问!'); } diff --git a/Application/Admin/Controller/UserActionLogController.class.php b/Application/Admin/Controller/UserActionLogController.class.php new file mode 100644 index 000000000..44af5127a --- /dev/null +++ b/Application/Admin/Controller/UserActionLogController.class.php @@ -0,0 +1,299 @@ + +// +---------------------------------------------------------------------- + +namespace Admin\Controller; + +use User\Api\UserApi; +use Com\Wechat; +use Com\WechatAuth; + +/** + * 后台用户控制器 + * @author 麦当苗儿 + */ +class UserActionLogController extends AdminController +{ + + public function index($p = 0) { + + $page = intval($p); + $page = $page ? $page : 1; //默认显示第一页数据 + $arraypage = $page; + + if (isset($_REQUEST['row'])) { + $row = $_REQUEST['row']; + } else { + $row = 10; + } + + $map = []; + + if ($_REQUEST['time_start']&&!$_REQUEST['time_end']) { + $map['create_time'] = ['egt',strtotime($_REQUEST['time_start'])]; + } + + if (!$_REQUEST['time_start']&&$_REQUEST['time_end']) { + $map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])]; + } + + if ($_REQUEST['time_start']&&$_REQUEST['time_end']) { + $map['create_time'] = ['egt',strtotime($_REQUEST['time_start'])]; + $map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])]; + } + + if ($_REQUEST['action']) { + $map['action'] = ['like',"%{$_REQUEST['action']}%"]; + } + + $data = M('user_action_log','tab_')->where($map)->page($page,$row)->order('create_time DESC')->select(); + + $count = M('user_action_log','tab_')->where($map)->order('create_time DESC')->count(); + + $page = set_pagination($count, $row); + if ($page) { + $this->assign('_page', $page);//分页 + } + + $this->assign('data',$data); + + $this->display(); + + } + + public function del() { + + if (!$_REQUEST['id']) { + $this->ajaxReturn(['status'=>1001]); + } + + $map['id'] = $_REQUEST['id']; + + $is_del = M('user_action_log','tab_')->where($map)->delete(); + + if ($is_del) { + $this->ajaxReturn(['status'=>1]); + } else { + $this->ajaxReturn(['status'=>0]); + } + + } + + public function export() { + + $xlsName = $_REQUEST['xlsname']; + + $xlsCell = array( + '编号','行为','游戏','玩家','操作时间','操作IP地址' + ); + + $map = []; + + if ($_REQUEST['time_start']&&!$_REQUEST['time_end']) { + $map['create_time'] = ['egt',strtotime($_REQUEST['time_start'])]; + } + + if (!$_REQUEST['time_start']&&$_REQUEST['time_end']) { + $map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])]; + } + + if ($_REQUEST['time_start']&&$_REQUEST['time_end']) { + $map['create_time'] = ['egt',strtotime($_REQUEST['time_start'])]; + $map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])]; + } + + if ($_REQUEST['action']) { + $map['action'] = ['like',"%{$_REQUEST['action']}%"]; + } + + $csvFileName = $xlsName.'.csv'; + //设置好告诉浏览器要下载excel文件的headers + header('Content-Description: File Transfer'); + header('Content-Type: application/vnd.ms-excel'); + header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + $fp = fopen('php://output', 'a');//打开output流 + mb_convert_variables('GBK', 'UTF-8', $xlsCell); + fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 + + $accessNum=M('user_action_log','tab_')->where($map)->order('create_time DESC')->count(); + + $perSize = 5000;//每次查询的条数 + $pages = ceil($accessNum / $perSize); + + for($i = 1; $i <= $pages; $i++) { + /* 获取频道列表 */ + + $xlsData = M('user_action_log','tab_') + ->field("id,action,game_name,account,create_time,ip") + ->where($map) + ->limit(($i-1)*$perSize ,$perSize) + ->order('create_time DESC')->select(); + + foreach($xlsData as $key => $value) { + + $value['create_time'] = date("Y-m-d H:i:s", $value['create_time']); + + mb_convert_variables('GBK', 'UTF-8', $value); + fputcsv($fp, $value); + + } + unset($xlsData);//释放变量的内存 + //刷新输出缓冲到浏览器 + ob_flush(); + flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。 + } + fclose($fp); + exit(); + + } + + public function operateLog($p = 0) { + + $page = intval($p); + $page = $page ? $page : 1; //默认显示第一页数据 + $arraypage = $page; + + if (isset($_REQUEST['row'])) { + $row = $_REQUEST['row']; + } else { + $row = 10; + } + + $map = []; + + if ($_REQUEST['time_start']&&!$_REQUEST['time_end']) { + $map['create_time'] = ['egt',strtotime($_REQUEST['time_start'])]; + } + + if (!$_REQUEST['time_start']&&$_REQUEST['time_end']) { + $map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])]; + } + + if ($_REQUEST['time_start']&&$_REQUEST['time_end']) { + $map['create_time'] = ['egt',strtotime($_REQUEST['time_start'])]; + $map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])]; + } + + if ($_REQUEST['action']) { + $map['op_name'] = ['like',"%{$_REQUEST['action']}%"]; + } + + $data = M('operation_log','tab_') + ->where($map) + ->page($page,$row) + ->order('create_time DESC') + ->select(); + + $count = M('operation_log','tab_')->where($map)->order('create_time DESC')->count(); + + $page = set_pagination($count, $row); + if ($page) { + $this->assign('_page', $page);//分页 + } + + $this->assign('data',$data); + + $this->display(); + + } + + public function operateLogDel() { + + if (!$_REQUEST['id']) { + $this->ajaxReturn(['status'=>1001]); + } + + $map['id'] = $_REQUEST['id']; + + $is_del = M('operation_log','tab_')->where($map)->delete(); + + if ($is_del) { + $this->ajaxReturn(['status'=>1]); + } else { + $this->ajaxReturn(['status'=>0]); + } + + } + + public function operateLoExport() { + + $xlsName = $_REQUEST['xlsname']; + + $xlsCell = array( + '编号','位置','类型','操作人','操作时间','操作IP地址' + ); + + $map = []; + + if ($_REQUEST['time_start']&&!$_REQUEST['time_end']) { + $map['create_time'] = ['egt',strtotime($_REQUEST['time_start'])]; + } + + if (!$_REQUEST['time_start']&&$_REQUEST['time_end']) { + $map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])]; + } + + if ($_REQUEST['time_start']&&$_REQUEST['time_end']) { + $map['create_time'] = ['egt',strtotime($_REQUEST['time_start'])]; + $map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])]; + } + + if ($_REQUEST['action']) { + $map['op_name'] = ['like',"%{$_REQUEST['action']}%"]; + } + + $csvFileName = $xlsName.'.csv'; + //设置好告诉浏览器要下载excel文件的headers + header('Content-Description: File Transfer'); + header('Content-Type: application/vnd.ms-excel'); + header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + $fp = fopen('php://output', 'a');//打开output流 + mb_convert_variables('GBK', 'UTF-8', $xlsCell); + fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 + + $accessNum=M('operation_log','tab_')->where($map)->order('create_time DESC')->count(); + + $perSize = 5000;//每次查询的条数 + $pages = ceil($accessNum / $perSize); + + for($i = 1; $i <= $pages; $i++) { + /* 获取频道列表 */ + + $xlsData = M('operation_log','tab_') + ->field("id,menu,key,op_name,admin_account,create_time,op_ip") + ->where($map) + ->limit(($i-1)*$perSize ,$perSize) + ->order('create_time DESC')->select(); + + foreach($xlsData as $key => $value) { + + $value['menu'] = $value['menu'].'-'.$value['key']; + $value['create_time'] = date("Y-m-d H:i:s", $value['create_time']); + unset($value['key']); + + mb_convert_variables('GBK', 'UTF-8', $value); + fputcsv($fp, $value); + + } + unset($xlsData);//释放变量的内存 + //刷新输出缓冲到浏览器 + ob_flush(); + flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。 + } + fclose($fp); + exit(); + + } + +} \ No newline at end of file diff --git a/Application/Admin/View/UserActionLog/index.html b/Application/Admin/View/UserActionLog/index.html new file mode 100644 index 000000000..0e10071ed --- /dev/null +++ b/Application/Admin/View/UserActionLog/index.html @@ -0,0 +1,239 @@ + + + + + + + + + + + + +
+ + +
+ +
+ + - +
+ + +
+
+ +
+   +
+ + +
+ 搜索 +
+ +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
编号行为游戏玩家操作时间操作IP地址操作
aOh! 暂时还没有内容!
{$data.id}{$data.action}{$data.game_name}{$data.account}{$data.create_time|date='Y-m-d H:i:s',###}{$data.ip}删除
+
+
+
+ 导出 + + {$_page|default=''} +
+
+ + + + if(C('COLOR_STYLE')=='blue_color') echo ''; + + + + + + diff --git a/Application/Admin/View/UserActionLog/operateLog.html b/Application/Admin/View/UserActionLog/operateLog.html new file mode 100644 index 000000000..e3b192799 --- /dev/null +++ b/Application/Admin/View/UserActionLog/operateLog.html @@ -0,0 +1,239 @@ + + + + + + + + + + + + +
+ + +
+ +
+ + - +
+ + +
+
+ +
+   +
+ + +
+ 搜索 +
+ +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
编号位置类型操作人操作时间操作IP地址操作
aOh! 暂时还没有内容!
{$data.id}{$data.menu}-{$data.key}{$data.menu}-{$data.key}{$data.op_name}{$data.admin_account}{$data.create_time|date='Y-m-d H:i:s',###}{$data.op_ip}删除
+
+
+
+ 导出 + + {$_page|default=''} +
+
+ + + + if(C('COLOR_STYLE')=='blue_color') echo ''; + + + + + + From dd478e264f673604dd352dc961a597dd2f15a8d0 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Tue, 25 Feb 2020 18:30:11 +0800 Subject: [PATCH 05/30] =?UTF-8?q?=E8=A1=8C=E4=B8=BA=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=8C=89=E7=85=A7=E5=8E=9F=E5=9E=8B=E4=BF=AE=E6=94=B9=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UserActionLogController.class.php | 32 ++++++++++++++----- .../Admin/View/UserActionLog/index.html | 14 ++++++-- .../Admin/View/UserActionLog/operateLog.html | 13 ++++++-- 3 files changed, 46 insertions(+), 13 deletions(-) diff --git a/Application/Admin/Controller/UserActionLogController.class.php b/Application/Admin/Controller/UserActionLogController.class.php index 44af5127a..f13a1cb1b 100644 --- a/Application/Admin/Controller/UserActionLogController.class.php +++ b/Application/Admin/Controller/UserActionLogController.class.php @@ -47,8 +47,12 @@ class UserActionLogController extends AdminController $map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])]; } - if ($_REQUEST['action']) { - $map['action'] = ['like',"%{$_REQUEST['action']}%"]; + if ($_REQUEST['username']) { + $map['account'] = ['like',"%{$_REQUEST['username']}%"]; + } + + if ($_REQUEST['game_name']) { + $map['game_name'] = ['like',"%{$_REQUEST['game_name']}%"]; } $data = M('user_action_log','tab_')->where($map)->page($page,$row)->order('create_time DESC')->select(); @@ -107,8 +111,12 @@ class UserActionLogController extends AdminController $map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])]; } - if ($_REQUEST['action']) { - $map['action'] = ['like',"%{$_REQUEST['action']}%"]; + if ($_REQUEST['username']) { + $map['account'] = ['like',"%{$_REQUEST['username']}%"]; + } + + if ($_REQUEST['game_name']) { + $map['game_name'] = ['like',"%{$_REQUEST['game_name']}%"]; } $csvFileName = $xlsName.'.csv'; @@ -182,8 +190,12 @@ class UserActionLogController extends AdminController $map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])]; } - if ($_REQUEST['action']) { - $map['op_name'] = ['like',"%{$_REQUEST['action']}%"]; + if ($_REQUEST['adminname']) { + $map['admin_account'] = ['like',"%{$_REQUEST['adminname']}%"]; + } + + if ($_REQUEST['op_type']) { + $map['op_type'] = $_REQUEST['op_type']; } $data = M('operation_log','tab_') @@ -246,8 +258,12 @@ class UserActionLogController extends AdminController $map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])]; } - if ($_REQUEST['action']) { - $map['op_name'] = ['like',"%{$_REQUEST['action']}%"]; + if ($_REQUEST['adminname']) { + $map['admin_account'] = ['like',"%{$_REQUEST['adminname']}%"]; + } + + if ($_REQUEST['op_type']) { + $map['op_type'] = $_REQUEST['op_type']; } $csvFileName = $xlsName.'.csv'; diff --git a/Application/Admin/View/UserActionLog/index.html b/Application/Admin/View/UserActionLog/index.html index 0e10071ed..e7470e045 100644 --- a/Application/Admin/View/UserActionLog/index.html +++ b/Application/Admin/View/UserActionLog/index.html @@ -38,7 +38,7 @@
-
+
@@ -49,10 +49,18 @@
-
-   +
+
+
+   +
搜索 diff --git a/Application/Admin/View/UserActionLog/operateLog.html b/Application/Admin/View/UserActionLog/operateLog.html index e3b192799..3cf5cd8ba 100644 --- a/Application/Admin/View/UserActionLog/operateLog.html +++ b/Application/Admin/View/UserActionLog/operateLog.html @@ -38,7 +38,7 @@
-
+
@@ -49,8 +49,17 @@
+
+ +
+
-   +  
From 02407d1c500bb1b750769f7ef635b45ee7c56983 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 25 Feb 2020 18:32:38 +0800 Subject: [PATCH 06/30] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/AdminController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Admin/Controller/AdminController.class.php b/Application/Admin/Controller/AdminController.class.php index 2e050f266..4f32df364 100644 --- a/Application/Admin/Controller/AdminController.class.php +++ b/Application/Admin/Controller/AdminController.class.php @@ -681,7 +681,7 @@ class AdminController extends Controller { } } if(!array_key_exists("op_name",$options)){ - $options['op_name'] = ($options['op_type'] == 1 ? "编辑" : ($options['op_type'] == 2 ? "删除" :"下载")); + $options['op_name'] = ($options['op_type'] == 1 ? "编辑" : ($options['op_type'] == 2 ? "删除" :"导出")); } //获取ip $addarray = [ From 2de1d9bccb8e45ef1a55311ce1bad7c2d4e9d12c Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 26 Feb 2020 09:27:32 +0800 Subject: [PATCH 07/30] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/MemberController.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index 66fd1c827..45e385a50 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -1235,7 +1235,7 @@ class MemberController extends ThinkController { if ($accounts) $map['account'] = ['in', array_unique(explode("\n", $accounts))]; if ($id) $map['id'] = ['in', array_unique(explode("\n", $id))]; - $users = M('user', 'tab_')->where($map)->field('id')->select(); + $users = M('user', 'tab_')->where($map)->field('id,lock_status')->select(); if($_POST['lock_remark']){ $res = M('user', 'tab_')->where($map)->setField(['lock_status' => $lock_status,"lock_remark" => $_POST['lock_remark']]); }else{ @@ -1244,10 +1244,11 @@ class MemberController extends ThinkController if ($res) { foreach ($users as $item) { + if($item['lock_status'] != $lock_status){ + $this->userEditOperationLog($item['id'],"锁定/解锁"); + } \Think\Log::actionLog('Member/lock_status', 'Member', $item['id']); } - $this->userEditOperationLog($id,"锁定/解锁"); - $this->success('操作成功!'); } else { $this->error('操作失败!'); From 756b3b997502ea0a04164a23e40c089637190901 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Wed, 26 Feb 2020 09:29:17 +0800 Subject: [PATCH 08/30] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=85=AC=E7=94=A8=E5=87=BD=E6=95=B0=E7=A7=BB=E5=88=B0extend.ph?= =?UTF-8?q?p=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 64 +++++++++++++++++++ .../Controller/AdminController.class.php | 63 +----------------- .../Controller/ExportController.class.php | 3 +- 3 files changed, 67 insertions(+), 63 deletions(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 0858173e2..0cf6ecbcb 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2198,4 +2198,68 @@ function a_array_unique($array){ return $data; } } +/** + * 操作日志 + * array( + * op_type=>操作类型 1:编辑 2:删除 3:下载, + * op_name=>操作说明 例如:编辑,删除,锁定等, + * url=>需要跳转的url 添加去列表加唯一id,编辑直接去编辑页面,下载可以重新下载(新开页面), + * key=>关键词:用户的账号,游戏的名词等 + * ) + */ + function addOperationLog($options) + { + $checkarr = ['op_type','url','key']; + foreach ($checkarr as $v) { + if(!array_key_exists($v,$options)){ + return false; + } + } + if(!array_key_exists("op_name",$options)){ + $options['op_name'] = ($options['op_type'] == 1 ? "编辑" : ($options['op_type'] == 2 ? "删除" :"下载")); + } + //获取ip + $addarray = [ + "op_ip"=>$_SERVER['REMOTE_ADDR'], + 'admin_id'=>$_SESSION['onethink_admin']['user_auth']['uid'], + 'admin_account'=>$_SESSION['onethink_admin']['user_auth']['username'], + 'op_type'=>$options['op_type'], + 'op_name'=>$options['op_name'], + 'url'=>$options['url'], + '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']; + } + getLink($menuname['pid'],$arr); + } + $addarray['menu'] = implode ( "-",array_reverse($arr)); + M("OperationLog","tab_")->add($addarray); + } + +function getLink($pid=0,&$arr){ + if($pid == 0){ + return; + } + $menuname = D("menu")->field('title,pid,group')->where("id = '{$pid}'")->find(); + if($menuname){ + $arr[] = $menuname['title']; + if(!empty($menuname['group'])){ + $arr[] = $menuname['group']; + } + if($menuname['pid'] != 0){ + getLink($menuname['pid'], $arr); + + } + } + +} + ?> diff --git a/Application/Admin/Controller/AdminController.class.php b/Application/Admin/Controller/AdminController.class.php index 4f32df364..3098e3112 100644 --- a/Application/Admin/Controller/AdminController.class.php +++ b/Application/Admin/Controller/AdminController.class.php @@ -663,67 +663,6 @@ class AdminController extends Controller { } } } - /** - * 操作日志 - * array( - * op_type=>操作类型 1:编辑 2:删除 3:下载, - * op_name=>操作说明 例如:编辑,删除,锁定等, - * url=>需要跳转的url 添加去列表加唯一id,编辑直接去编辑页面,下载可以重新下载(新开页面), - * key=>关键词:用户的账号,游戏的名词等 - * ) - */ - public function addOperationLog($options) - { - $checkarr = ['op_type','url','key']; - foreach ($checkarr as $v) { - if(!array_key_exists($v,$options)){ - $this->error('操作日志添加,参数错误'); - } - } - if(!array_key_exists("op_name",$options)){ - $options['op_name'] = ($options['op_type'] == 1 ? "编辑" : ($options['op_type'] == 2 ? "删除" :"导出")); - } - //获取ip - $addarray = [ - "op_ip"=>$_SERVER['REMOTE_ADDR'], - 'admin_id'=>$_SESSION['onethink_admin']['user_auth']['uid'], - 'admin_account'=>$_SESSION['onethink_admin']['user_auth']['username'], - 'op_type'=>$options['op_type'], - 'op_name'=>$options['op_name'], - 'url'=>$options['url'], - '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']; - } - $this-> getLink($menuname['pid'],$arr); - } - $addarray['menu'] = implode ( "-",array_reverse($arr)); - M("OperationLog","tab_")->add($addarray); - } - public function getLink($pid=0,&$arr){ - if($pid == 0){ - return; - } - $menuname = D("menu")->field('title,pid,group')->where("id = '{$pid}'")->find(); - if($menuname){ - $arr[] = $menuname['title']; - if(!empty($menuname['group'])){ - $arr[] = $menuname['group']; - } - if($menuname['pid'] != 0){ - $this->getLink($menuname['pid'], $arr); - - } - } - - } + } diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 78804a5bf..8c9a21437 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -4125,7 +4125,8 @@ class ExportController extends Controller $xlsSummary[] = $data['sum'][$key]; - } else { + } + else { $start = I('start',date('Y-m-d',strtotime('-1 day'))); From 580eb9dea37831d4aca9ba2b17c3dcd82cfcd293 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 26 Feb 2020 09:30:59 +0800 Subject: [PATCH 09/30] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E5=85=AC=E5=85=B1=E5=87=BD=E6=95=B0=E5=90=8E=E7=9A=84=E5=8F=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/MemberController.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index 45e385a50..abcf1b81b 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -1705,7 +1705,6 @@ class MemberController extends ThinkController if($op_name){ $option['op_name'] = $op_name; } - $this->addOperationLog($option); - # code... + addOperationLog($option); } } \ No newline at end of file From 3f4f39e238ebc9be7a8703681b041f9d498c49cf Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Wed, 26 Feb 2020 09:41:57 +0800 Subject: [PATCH 10/30] =?UTF-8?q?=E5=B0=81=E8=A3=85=E6=97=B6=E9=97=B4?= =?UTF-8?q?=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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 0cf6ecbcb..b872ae27c 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2262,4 +2262,11 @@ function getLink($pid=0,&$arr){ } +function getNowDate() { + + return date('YmdHis',time()); + +} + + ?> From 148d445f10e8a4ff993ada516f0853ce7e9bf432 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 26 Feb 2020 09:42:44 +0800 Subject: [PATCH 11/30] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/MemberController.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index abcf1b81b..893eaa0b7 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -206,6 +206,13 @@ class MemberController extends ThinkController "small_count"=>"小号","vip_level"=>"VIP等级","register_type"=>"注册方式","register_time"=>"注册时间","register_ip"=>"注册IP","login_time"=>"最后登录时间", "device_number"=>"设备号","lock_remark"=>"锁定备注","lock_status"=>"账号状态","check_status"=>"拉黑状态" ); + //操作日志 + unset($_GET['export']); + addOperationLog(array( + "op_type"=>3, + "key"=>date("YmdHis",time()), + "url"=>U("Member/user_info",$_GET), + )); data2csv($data,"玩家_玩家列表",$field); } From 7141e3752e431613a5ea90e1f533cf2f709213a3 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 26 Feb 2020 09:47:01 +0800 Subject: [PATCH 12/30] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=97=A5=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); From 97ff3baaff02f825081e0f153445d970358a308a Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 26 Feb 2020 09:50:46 +0800 Subject: [PATCH 13/30] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 2 +- Application/Admin/Controller/MemberController.class.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 203ffbb1f..40a5dfd66 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2217,7 +2217,7 @@ function a_array_unique($array){ } } if(!array_key_exists("op_name",$options)){ - $options['op_name'] = ($options['op_type'] == 1 ? "编辑" : ($options['op_type'] == 2 ? "删除" :"下载")); + $options['op_name'] = ($options['op_type'] == 1 ? "编辑" : ($options['op_type'] == 2 ? "删除" :"导出")); } //获取ip $addarray = [ diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index 8a29827ac..b9f11aa00 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -212,6 +212,7 @@ class MemberController extends ThinkController "op_type"=>3, "key"=>getNowDate(), "url"=>U("Member/user_info",$_GET), + 'menu'=>"用户-玩家组-玩家列表-导出" )); data2csv($data,"玩家_玩家列表",$field); } From 0e0a7263e3a87ff6400e1ee106227a8848df5876 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 26 Feb 2020 11:15:11 +0800 Subject: [PATCH 14/30] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97-?= =?UTF-8?q?=E9=98=B2=E5=88=B7=E9=A2=84=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/MemberController.class.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index b9f11aa00..39befaa18 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -1358,7 +1358,17 @@ class MemberController extends ThinkController } elseif ($name == 'CACHE_TYPE_HOST' || $name == 'CACHE_TYPE_TIME') { $this->set_config($name, $value); } - $Config->where($map)->setField('value', $value); + + $res = $Config->where($map)->setField('value', $value); + if($res >0){ + //操作日志 + addOperationLog(array( + "op_type"=>1, + "key"=>$name, + "url"=>U("Member/blockconfig") + )); + } + } } S('DB_CONFIG_DATA', null); From 50e4185d9c080c7265cf1d4c4a047106016a3f32 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 26 Feb 2020 14:28:23 +0800 Subject: [PATCH 15/30] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97-?= =?UTF-8?q?=E7=99=BB=E9=99=86=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/MemberController.class.php | 21 +++++++++++++++++-- .../Admin/View/Member/login_record.html | 2 +- Data/update.sql | 6 +++++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index 39befaa18..5d7359bb6 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -1203,12 +1203,20 @@ class MemberController extends ThinkController $this->assign('show_data_power', $show_data_power); parent::lists("UserLoginRecord", $p, $extend['map']); } - + //登陆记录删除 public function del($model = null, $ids = null) { $map = array(); if (isset($_REQUEST['id'])) { $map['id'] = $_REQUEST['id']; + //获取玩家账号 + + addOperationLog(array( + "op_type"=>2, + "key"=>M('user_login_record', 'tab_')->where($map)->field('user_account')->find()['user_account'], + "url"=>U("Member/login_record") + )); + $data = M('user_login_record', 'tab_')->where($map)->delete(); \Think\Log::actionLog('Member/del', 'Member', $_REQUEST['id']); $this->success('删除成功!', U('login_record'), 2); @@ -1222,9 +1230,18 @@ class MemberController extends ThinkController if (empty($ids)) { $this->error('请选择要操作的数据!'); } + $ids = implode(",", $ids); $list = M("user_login_record", "tab_"); $map['id'] = array("in", $ids); - //$map['status'] = 0; + //操作日志 + $lr = M("user_login_record", "tab_")->field('user_account')->where($map)->select(); + foreach ($lr as $k => $v) { + addOperationLog(array( + "op_type"=>2, + "key"=>$v['user_account'], + "url"=>U("Member/login_record") + )); + } $delete = $list->where($map)->delete(); if ($delete) { \Think\Log::actionLog('Member/delprovide', 'Member', 1); diff --git a/Application/Admin/View/Member/login_record.html b/Application/Admin/View/Member/login_record.html index 102143a0b..1a3c9047c 100644 --- a/Application/Admin/View/Member/login_record.html +++ b/Application/Admin/View/Member/login_record.html @@ -142,7 +142,7 @@ - + {$data.user_account} diff --git a/Data/update.sql b/Data/update.sql index dc798d286..dad48a2bc 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1371,4 +1371,8 @@ CREATE TABLE `tab_operation_log` ( `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `op_ip` varchar(16) DEFAULT '0' COMMENT '登陆ip', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; \ No newline at end of file +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; + +-- 2020-02-25 chenzhi spend表索引优化 +ALTER TABLE `tab_spend` +ADD INDEX `game_stayus` (`pay_status`, `pay_game_status`) USING BTREE ; From 55fd5d94e814d0933d1422dcf17ea99f0571c380 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 26 Feb 2020 14:58:21 +0800 Subject: [PATCH 16/30] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=EF=BC=8C=E9=98=B2=E6=B2=89=E8=BF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/UserController.class.php | 10 ++++++++++ Application/Admin/View/User/age.html | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/UserController.class.php b/Application/Admin/Controller/UserController.class.php index f24028f15..09f8ecd63 100644 --- a/Application/Admin/Controller/UserController.class.php +++ b/Application/Admin/Controller/UserController.class.php @@ -706,6 +706,16 @@ class UserController extends AdminController $data = $_POST; $a = new ToolController(); $re = $a->save($data); + //操作日志 + $type = $_REQUEST['type']; + $meta_title = ($_REQUEST['type'] == 1 ? "实名认证" : '防沉迷'); + addOperationLog(array( + "op_type"=>1, + "key"=>$type, + "menu"=>"用户-玩家组-实名认证设置-".$meta_title, + "url"=>U("Member/age",array('type'=>$type)) + )); + \Think\Log::actionLog('User/age', 'User', 1); $this->success('保存成功'); } else { diff --git a/Application/Admin/View/User/age.html b/Application/Admin/View/User/age.html index a0a8f9a3a..9958aaadf 100644 --- a/Application/Admin/View/User/age.html +++ b/Application/Admin/View/User/age.html @@ -38,7 +38,7 @@
-
+ From dc171af55694953005d1381af2c83c98e1818b0e Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 26 Feb 2020 15:23:38 +0800 Subject: [PATCH 17/30] =?UTF-8?q?=E5=88=86=E6=8E=A7=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=B8=8E=E8=A7=A3=E9=99=A4=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 4 ++-- .../Admin/Controller/MemberController.class.php | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 40a5dfd66..91d90457b 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2201,7 +2201,7 @@ function a_array_unique($array){ /** * 操作日志 * array( - * op_type=>操作类型 1:编辑 2:删除 3:下载, + * op_type=>操作类型 0:新增,1:编辑 2:删除 3:下载, * op_name=>操作说明 例如:编辑,删除,锁定等, * url=>需要跳转的url 添加去列表加唯一id,编辑直接去编辑页面,下载可以重新下载(新开页面), * key=>关键词:用户的账号,游戏的名词等, @@ -2217,7 +2217,7 @@ function a_array_unique($array){ } } if(!array_key_exists("op_name",$options)){ - $options['op_name'] = ($options['op_type'] == 1 ? "编辑" : ($options['op_type'] == 2 ? "删除" :"导出")); + $options['op_name'] = ($options['op_type'] == 1 ? "编辑" : ($options['op_type'] == 2 ? "删除" :($options['op_type'] == 3 ? "导出" :"新增"))); } //获取ip $addarray = [ diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index 5d7359bb6..e72abb880 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -1668,7 +1668,7 @@ class MemberController extends ThinkController if (!empty($tag)) { $map['tag'] = $tag; } - $list = M('device_bans', 'tab_')->where($map)->page($p, $row)->select(); + $list = M('device_bans', 'tab_')->where($map)->page($p, $row)->order("create_time desc")->select(); $count = M('device_bans', 'tab_')->where($map)->count(); if (!empty($list)) { foreach ($list as &$item) { @@ -1721,12 +1721,24 @@ class MemberController extends ThinkController if ($item) { return $this->error("该禁用已经存在(ID:{$item['id']})"); } - M('device_bans', 'tab_')->add(['type' => $type, 'tag' => $tag, 'create_time' => time(), 'operator_id' => is_login()]); + $res = M('device_bans', 'tab_')->add(['type' => $type, 'tag' => $tag, 'create_time' => time(), 'operator_id' => is_login()]); + addOperationLog(array( + "op_type"=>0, + "key"=>$res, + "menu"=>"用户-玩家组-分控列表-新增", + "url"=>U("Member/device_bans_list") + )); } return $this->success("新增成功", U('Member/device_bans_list')); } else { M('device_bans', 'tab_')->where(['id' => $id])->delete(); + addOperationLog(array( + "op_type"=>2, + "key"=>$id, + "menu"=>"用户-玩家组-分控列表-解除", + "url"=>U("Member/device_bans_list") + )); return $this->success("解除成功"); } } From a6a29bf63ab7ec07a43e8237e614a5cdcfb456a3 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Wed, 26 Feb 2020 15:24:56 +0800 Subject: [PATCH 18/30] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/AjaxController.class.php | 40 +++++++++++ .../Controller/ExportController.class.php | 71 ++++++++++++++++++- .../Controller/PlatformController.class.php | 6 ++ .../Admin/View/Statistics/overview.html | 28 +++++++- 4 files changed, 141 insertions(+), 4 deletions(-) diff --git a/Application/Admin/Controller/AjaxController.class.php b/Application/Admin/Controller/AjaxController.class.php index f63370a9f..61fbd4292 100644 --- a/Application/Admin/Controller/AjaxController.class.php +++ b/Application/Admin/Controller/AjaxController.class.php @@ -540,4 +540,44 @@ class AjaxController extends ThinkController{ $this->ajaxReturn($data); } + /** + * 操作日志 + * option: + * array( + * op_type=>操作类型 1:编辑 2:删除 3:下载, + * op_name=>操作说明 例如:编辑,删除,锁定等, + * url=>需要跳转的url 添加去列表加唯一id,编辑直接去编辑页面,下载可以重新下载(新开页面), + * key=>关键词:用户的账号,游戏的名词等, + * menu=>非必须,菜单目录,不存在的话按控制器寻找 + * ) + * get: 页面get参数 + * + * return: 0:错误 1:成功 + */ + public function addOperationLog() { + + $Get = $_GET['get']; + $option = $_GET['option']; + + if (!$option['key']) { + $option['key'] = getNowDate(); + } + + if (!$option['url']) { + $this->ajaxReturn(['code'=>0]); + } + + if (!$option['menu']) { + $this->ajaxReturn(['code'=>0]); + } + + if (!$option['op_name']) { + $this->ajaxReturn(['code'=>0]); + } + + addOperationLog(['op_type'=>$option['op_type'],'key'=>$option['key'],'op_name'=>$option['op_name'],'url'=>U($option['url'],$Get),'menu'=>$option['menu']]); + + $this->ajaxReturn(['code'=>1]); + } + } \ No newline at end of file diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 8c9a21437..347a6aaee 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -2502,6 +2502,12 @@ class ExportController extends Controller $data[$key]['game_id'] = get_game_name($request['game_id']); $data[$key]['promote_id'] = get_promote_account($request['promote_id']); } + + $GetData = $_GET; + unset($GetData['xlsname']); + + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出ARPU分析','url'=>U('stat/userarpu',$GetData),'menu'=>'统计-数据分析-ARPU分析']); + $xlsData = $data; $this->exportExcel($xlsName, $xlsCell, $xlsData); } @@ -2625,6 +2631,12 @@ class ExportController extends Controller 'week'=>$total['sum_week'], 'mounth'=>$total['sum_mounth'] ); + + $GetData = $_GET; + unset($GetData['xlsname']); + + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出游戏注册统计','url'=>U('Platform/game_statistics',$GetData),'menu'=>'统计-统计-平台统计-游戏注册统计']); + $xlsData = $data; $this->exportExcel($xlsName, $xlsCell, $xlsData); } @@ -2719,6 +2731,13 @@ class ExportController extends Controller 'week'=>$total['sum_week'], 'mounth'=>$total['sum_mounth'] ); + + $GetData = $_GET; + unset($GetData['xlsname']); + unset($GetData['type']); + + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出游戏充值统计','url'=>U('Platform/gamepay_statistics',$GetData),'menu'=>'统计-统计-平台统计-游戏充值统计']); + $xlsData = $data; $this->exportExcel($xlsName, $xlsCell, $xlsData); } @@ -2815,6 +2834,13 @@ class ExportController extends Controller 'week'=>$total['sum_week'], 'mounth'=>$total['sum_mounth'] ); + + $GetData = $_GET; + unset($GetData['xlsname']); + unset($GetData['type']); + + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出注册方式统计','url'=>U('Platform/resway_statistics',$GetData),'menu'=>'统计-统计-平台统计-注册方式统计']); + $xlsData = $data; $this->exportExcel($xlsName, $xlsCell, $xlsData); } @@ -2914,6 +2940,13 @@ class ExportController extends Controller 'week'=>$total['sum_week'], 'mounth'=>$total['sum_mounth'] ); + + $GetData = $_GET; + unset($GetData['xlsname']); + unset($GetData['type']); + + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出充值方式统计','url'=>U('Platform/payway_statistics',$GetData),'menu'=>'统计-统计-平台统计-充值方式统计']); + $xlsData = $data; $this->exportExcel($xlsName, $xlsCell, $xlsData); } @@ -3070,6 +3103,12 @@ class ExportController extends Controller 'mounth'=>$total['sum_mounth'] ); $xlsData = $data; + + $GetData = $_GET; + unset($GetData['xlsname']); + + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出推广员统计','url'=>U('Platform/promote_statistics',$GetData),'menu'=>'统计-统计-推广员统计-推广员注册统计']); + // var_dump($xlsData);die(); $this->exportExcel($xlsName, $xlsCell, $xlsData); } @@ -3202,6 +3241,7 @@ class ExportController extends Controller 'week'=>$total['sum_week'], 'mounth'=>$total['sum_mounth'] ); + $xlsData = $data; $this->exportExcel($xlsName, $xlsCell, $xlsData); } @@ -3222,7 +3262,7 @@ class ExportController extends Controller $end = empty(I('end')) ? time_format(time(),'Y-m-d') : I('end'); $gameId = I('game_id', 0); $promoteId = I('promote_id', 0); - + $status = true; $data = false; $error = ''; @@ -3294,6 +3334,12 @@ class ExportController extends Controller ['retention_day15', '15日留存'], ['retention_day30', '30日留存'], ]; + + $GetData = $_GET; + unset($GetData['xlsname']); + + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出留存率分析','url'=>U('stat/userretention',$GetData),'menu'=>'统计-数据分析-留存率分析']); + $xlsData = $data; $xlsName = $_REQUEST['xlsname']?$_REQUEST['xlsname']:'留存分析'; $this->exportExcel($xlsName, $xlsCell, $xlsData); @@ -3600,6 +3646,11 @@ class ExportController extends Controller $xlsData[] = $v; } + $GetData = $_GET; + unset($GetData['xlsname']); + + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出用户分析','url'=>U('stat/user',$GetData),'menu'=>'统计-数据分析-用户分析']); + $this->exportExcel($xlsName, $xlsCell, $xlsData); } @@ -3734,6 +3785,11 @@ class ExportController extends Controller $xlsData[] = $v; } + $GetData = $_GET; + unset($GetData['xlsname']); + + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出LTV统计','url'=>U('Statistics/ltv',$GetData),'menu'=>'统计-统计-LTV统计']); + $this->exportExcel($xlsName, $xlsCell, $xlsData); } @@ -3763,7 +3819,8 @@ class ExportController extends Controller $xlsData = $data[$key]; $xlsSummary[] = $data['sum'][$key]; - } else { + } + else { $start = I('start',date('Y-m-d',strtotime('-1 day'))); @@ -3894,6 +3951,10 @@ class ExportController extends Controller $xlsSummary[] = $export['sum'][$key]; } + $GetData = $_GET; + unset($GetData['export']); + + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出总览','url'=>U('Statistics/overview',$GetData),'menu'=>'统计-统计-总览']); $this->exportExcel($xlsName, $xlsCell, $xlsData); @@ -4116,6 +4177,12 @@ class ExportController extends Controller ); } + $GetData = $_GET; + unset($GetData['key']); + unset($GetData['hours']); + unset($GetData['name']); + unset($GetData['xlsname']); + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出应用概况','url'=>U('Stat/device_survey',$GetData),'menu'=>'统计-数据分析-应用概况']); if (is_file(RUNTIME_PATH.'/device_data_foldline.txt')) { diff --git a/Application/Admin/Controller/PlatformController.class.php b/Application/Admin/Controller/PlatformController.class.php index 4cc759222..6a53681e6 100644 --- a/Application/Admin/Controller/PlatformController.class.php +++ b/Application/Admin/Controller/PlatformController.class.php @@ -768,6 +768,12 @@ class PlatformController extends ThinkController $size = $row;//每页显示的记录数 $pnum = ceil(count($data) / $size); //总页数,ceil()函数用于求大于数字的最小整数 if(isset($_REQUEST['export'])){ + + $GetData = $_GET; + unset($GetData['export']); + + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出推广员充值统计','url'=>U('Platform/promotepay_statistics',$GetData),'menu'=>'统计-统计-推广员统计-推广员充值统计']); + data2csv($data,'推广员充值统计',array( "promote_account"=>"推广员账号", "count"=>"累计充值", diff --git a/Application/Admin/View/Statistics/overview.html b/Application/Admin/View/Statistics/overview.html index d83399f1f..cde2794d0 100644 --- a/Application/Admin/View/Statistics/overview.html +++ b/Application/Admin/View/Statistics/overview.html @@ -661,8 +661,13 @@ }else{ times = ydata["date"].split(","); } - var value = ydata[but].split(","); - + + if(ydata[but]) { + var value = ydata[but].split(","); + } else { + var value = [0]; + } + if(but == 'news'){ var str = `时间,新增用户\n`; var title = "新增用户"; @@ -679,6 +684,25 @@ str += times[i]+"\t,"+value[i]+"\t\n"; } var url = 'data:text/csv;charset=utf-8,\ufeff' + encodeURIComponent(str); + + + var optionData = {url:'Statistics/overview',menu:'统计-统计-总览',op_name:'导出总览',op_type:'3'}; + + $.ajax({ + type: "get", + url: '{:U("Ajax/addOperationLog")}', + data: {get:,option:optionData}, + dataType: "json", + success: function(data){ + if(data.code){ + layer.msg('保存成功'); + }else{ + layer.msg('保存失败'); + } + } + }) + + downloadCSV(url, title+'.csv'); }); //导出csv From 40d2c2777fca2e7e7a71046aab4dcfefb3d72099 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 26 Feb 2020 15:44:45 +0800 Subject: [PATCH 19/30] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=99=BD=E5=90=8D?= =?UTF-8?q?=E5=8D=95=E5=A2=9E=E5=88=A0=E6=94=B9=E6=93=8D=E4=BD=9C=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TestWhiteListController.class.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Application/Admin/Controller/TestWhiteListController.class.php b/Application/Admin/Controller/TestWhiteListController.class.php index 98566be9a..51fb4c504 100644 --- a/Application/Admin/Controller/TestWhiteListController.class.php +++ b/Application/Admin/Controller/TestWhiteListController.class.php @@ -117,6 +117,13 @@ class TestWhiteListController extends ThinkController // echo M('test_white_list','tab_')->_sql();die(); if($whiteList) { + // + addOperationLog(array( + "op_type"=>1, + "key"=>$data['account'], + "menu"=>"用户-玩家组-测试白名单-锁定/开启", + "url"=>U("TestWhiteList/lists",array('account'=>$data['account'])) + )); $this->ajaxReturn(['status'=>1,'msg'=>"修改白名单成功"]); } else { $this->ajaxReturn(['status'=>0,'msg'=>"修改白名单成功"]); @@ -162,7 +169,15 @@ class TestWhiteListController extends ThinkController $whiteList = M('test_white_list','tab_')->add($data); if($whiteList) { + //操作日志 + addOperationLog(array( + "op_type"=>0, + "key"=>$data['account'], + "menu"=>"用户-玩家组-测试白名单-添加测试账号", + "url"=>U("TestWhiteList/lists",array('account'=>$data['account'])) + )); $this->success('添加白名单成功',U('TestWhiteList/lists')); + } else { $this->error('添加白名单失败'); } @@ -214,6 +229,12 @@ class TestWhiteListController extends ThinkController $del = M('test_white_list','tab_')->where(['id'=>$userId])->delete(); if ($del) { + addOperationLog(array( + "op_type"=>2, + "key"=>$userWhite['account'], + "menu"=>"用户-玩家组-测试白名单-删除", + "url"=>U("TestWhiteList/lists") + )); $this->ajaxReturn(['status'=>0,'msg'=>"删除成功"]); } else { $this->ajaxReturn(['status'=>0,'msg'=>"删除失败"]); From 3a9575c602861cb53e5042a8d13ef75cb159710a Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 26 Feb 2020 16:26:29 +0800 Subject: [PATCH 20/30] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=A2=9E=E5=88=A0=E6=94=B9=E5=AF=BC=E5=87=BA-?= =?UTF-8?q?=E6=93=8D=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(); From 81830703f36985265ea1302bedf7fd39522b60e6 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 26 Feb 2020 18:19:51 +0800 Subject: [PATCH 21/30] =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=9D=83=E9=99=90-?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=971?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AuthManagerController.class.php | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/Application/Admin/Controller/AuthManagerController.class.php b/Application/Admin/Controller/AuthManagerController.class.php index 2ee93a048..2505fe021 100644 --- a/Application/Admin/Controller/AuthManagerController.class.php +++ b/Application/Admin/Controller/AuthManagerController.class.php @@ -220,8 +220,18 @@ class AuthManagerController extends AdminController{ if ( empty($data['id']) ) { \Think\Log::actionLog('AuthManager/createGroup','authGroup',1); $r = $AuthGroup->add(); + addOperationLog(array( + "op_type"=>0, + "key"=> $_POST['title'], + "url"=>U("User/index") + )); }else{ \Think\Log::actionLog('AuthManager/editGroup','authGroup',1); + addOperationLog(array( + "op_type"=>1, + "key"=> $_POST['title'], + "url"=>U("User/index") + )); $r = $AuthGroup->save(); } if($r===false){ @@ -239,9 +249,46 @@ class AuthManagerController extends AdminController{ * @author 朱亚杰 */ public function changeStatus($method=null){ + //操作日志-begin + if(is_array ( $_REQUEST['id'] )){ + $ids = implode(",",$_REQUEST['id']); + }else{ + $ids = $_REQUEST['id']; + } + $lr = M("AuthGroup")->field('title,status')->where("id in ({$ids})")->select(); + $status = 0; + $op_name =''; + $op_type =1; if ( empty($_REQUEST['id']) ) { $this->error('请选择要操作的数据!'); } + // 1正常,为0禁用,-1为删除' + switch ( strtolower($method) ){ + case 'forbidgroup': + $status = 0; + $op_name = "禁用"; + break; + case 'resumegroup': + $status = 1; + $op_name = "正常"; + break; + case 'deletegroup': + $status = -1; + $op_name = "删除"; + $op_type = 2; + break; + } + foreach ($lr as $k => $v) { + if($v['status'] != $status){ + addOperationLog(array( + "op_type"=>$op_type, + "key"=> $v['title'], + "menu"=>"用户-管理组-角色权限-".$op_name, + "url"=>U("User/index") + )); + } + } + //操作日志end switch ( strtolower($method) ){ case 'forbidgroup': \Think\Log::actionLog('AuthManager/changeStatus?method=forbidGroup','AuthGroup',$_REQUEST['id']); From 3c628fa1c62c3908957858b5ff0b3e3779c08824 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 27 Feb 2020 09:19:09 +0800 Subject: [PATCH 22/30] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 30 +++++++++++++++++++ .../PromoteGameRatioController.class.php | 17 +++++++++++ .../Controller/QueryController.class.php | 22 ++++++++++++++ .../Controller/SettlementController.class.php | 12 ++++++++ .../UserActionLogController.class.php | 12 ++++++++ Data/update.sql | 15 ++++++++++ 6 files changed, 108 insertions(+) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 91d90457b..222b590e0 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2275,5 +2275,35 @@ function getNowDate() { } +//根据推广员id获取推广员姓名 +function getPromoteName($id) { + + if (!$id) { + return ''; + } + + $name = M('promote','tab_') + ->where(['id'=>$id]) + ->find()['account']; + + return $name; + +} + +//根据关联id获取游戏名称 +function getrelationGameName($id) { + + if (!$id) { + return ''; + } + + $name = M('game','tab_') + ->where(['relation_game_id'=>$id]) + ->find()['relation_game_name']; + + return $name; + +} + ?> diff --git a/Application/Admin/Controller/PromoteGameRatioController.class.php b/Application/Admin/Controller/PromoteGameRatioController.class.php index 95406194e..9960d855c 100644 --- a/Application/Admin/Controller/PromoteGameRatioController.class.php +++ b/Application/Admin/Controller/PromoteGameRatioController.class.php @@ -202,6 +202,12 @@ class PromoteGameRatioController extends ThinkController 'applicant' => '申请人', 'reviewer' => '确认人', ]; + + $GetData = $_GET; + unset($GetData['export']); + + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出公会分成管理','url'=>U('PromoteGameRatio/lists',$GetData),'menu'=>'统计-结算管理-公会分成管理']); + data2csv($records,$csvTitle, $field); exit; } @@ -330,6 +336,9 @@ class PromoteGameRatioController extends ThinkController } } } + + addOperationLog(['op_type'=>1,'key'=>getPromoteName($promoteGameRatio['promote_id']).getrelationGameName($promoteGameRatio['game_id']),'op_name'=>'修改游戏分成比例申请','url'=>U('PromoteGameRatio/applyRatio',['id'=>$promoteGameRatio['id']]),'menu'=>'推广员-结算单管理-公会分成管理']); + } else {//新增 if (empty($params['promote_id'])) { $this->error('请选择会长账号'); @@ -382,6 +391,9 @@ class PromoteGameRatioController extends ThinkController } } M()->commit(); + + addOperationLog(['op_type'=>0,'key'=>getPromoteName($promoteId).getrelationGameName($relationGameId),'op_name'=>'生成游戏分成比例申请','url'=>U('PromoteGameRatio/lists'),'menu'=>'推广员-结算单管理-公会分成管理-生成游戏分成比例申请']); + } $this->success('保存成功', U('lists')); @@ -504,6 +516,7 @@ class PromoteGameRatioController extends ThinkController $save['remark'] = $remark; } $result = D(self::MODEL_NAME)->where($map)->save($save); +// dump($result);die(); if ($result) { $model = new PromoteGameRatioModel(); $promoteGameRatios = D(self::MODEL_NAME)->where(array('relation_game_id' => ['in', $relationGameIds]))->select(); @@ -528,8 +541,12 @@ class PromoteGameRatioController extends ThinkController $spendSave['selle_ratio'] = $promoteGameRatio['ratio']; M('spend', 'tab_')->where($spendMap)->save($spendSave); + addOperationLog(['op_type'=>1,'key'=>getPromoteName($promoteGameRatio['promote_id']).getrelationGameName($promoteGameRatio['relation_game_id']),'op_name'=>'审核游戏分成比例订单','url'=>U('PromoteGameRatio/lists'),'menu'=>'推广员-结算单管理-公会分成管理-审核通过']); } + } else { + addOperationLog(['op_type'=>1,'key'=>getPromoteName($promoteGameRatio['promote_id']).getrelationGameName($promoteGameRatio['relation_game_id']),'op_name'=>'审核游戏分成比例订单','url'=>U('PromoteGameRatio/lists'),'menu'=>'推广员-结算单管理-公会分成管理-审核拒绝']); } + } } $this->success('操作成功'); diff --git a/Application/Admin/Controller/QueryController.class.php b/Application/Admin/Controller/QueryController.class.php index 28112d1a6..1d73813ae 100644 --- a/Application/Admin/Controller/QueryController.class.php +++ b/Application/Admin/Controller/QueryController.class.php @@ -1242,6 +1242,19 @@ class QueryController extends ThinkController $save['status'] = $status; $res = $withdraw->where($map)->save($save); if ($res) { + $text = ''; + if ($status == 1) { + $text = '汇款通过'; + } else if ($status == 2) { + $text = '确认汇款'; + } + unset($map['status']); + $withdraw_number = $withdraw->where($map)->select(); + + foreach ($withdraw_number as $key => $value) { + addOperationLog(['op_type' => 1, 'key' => $value['widthdraw_number'], 'op_name' => $text, 'url' => U('Query/withdraw'), 'menu' => '推广员-结算单管理-推广提现-' . $text]); + } + $this->success('操作成功', U('withdraw')); } else { $this->error('操作失败'); @@ -1258,6 +1271,7 @@ class QueryController extends ThinkController } switch ($case) { case 'deny': + $data = $this->set_withdraw_deny(); break; case 'upload_transfer_proof': @@ -1302,6 +1316,14 @@ class QueryController extends ThinkController $data['status'] = 0; $data['msg'] = '驳回失败'; } else { + + unset($map['status']); + $withdraw_number = $withdraw->where($map)->select(); + + foreach ($withdraw_number as $key => $value) { + addOperationLog(['op_type'=>1,'key'=>$value['widthdraw_number'],'op_name'=>'驳回汇款请求','url'=>U('Query/withdraw'),'menu'=>'推广员-结算单管理-推广提现-驳回']); + } + $data['status'] = 1; $data['msg'] = '驳回成功'; } diff --git a/Application/Admin/Controller/SettlementController.class.php b/Application/Admin/Controller/SettlementController.class.php index 900410962..6e731b7bb 100644 --- a/Application/Admin/Controller/SettlementController.class.php +++ b/Application/Admin/Controller/SettlementController.class.php @@ -89,6 +89,13 @@ class SettlementController extends ThinkController $this->assign('action', $action); if ($delete) { $res = M('settlement_sheet', 'tab_')->where(['id'=>$id])->delete(); + + $GetData = $_GET; + unset($GetData['id']); + unset($GetData['delete']); + + addOperationLog(['op_type'=>2,'key'=>getNowDate(),'op_name'=>'删除汇总结算单管理','url'=>U('settlement/sheetList',$GetData),'menu'=>'推广员-结算单管理-汇总结算单管理']); + return $res ? $this->success('删除成功', '', true) : $this->success('删除失败', '', true); } $this->meta_title = '结算单管理'; @@ -388,6 +395,11 @@ class SettlementController extends ThinkController $notice['create_time'] = time(); $notice['game_id'] = $res; M('msg', 'tab_')->add($notice); + + $GetData = $_POST; + + addOperationLog(['op_type'=>0,'key'=>getNowDate(),'op_name'=>'生成汇总结算单','url'=>U('settlement/generateSettlementSheet',$GetData),'menu'=>'推广员-结算单管理-生成汇总结算单']); + return $res ? $this->success('生成成功', true, true) : $this->error('生成失败', true, true); } } diff --git a/Application/Admin/Controller/UserActionLogController.class.php b/Application/Admin/Controller/UserActionLogController.class.php index f13a1cb1b..ac8608df8 100644 --- a/Application/Admin/Controller/UserActionLogController.class.php +++ b/Application/Admin/Controller/UserActionLogController.class.php @@ -57,6 +57,18 @@ class UserActionLogController extends AdminController $data = M('user_action_log','tab_')->where($map)->page($page,$row)->order('create_time DESC')->select(); + foreach($data as $key=>$value) { + $remarks = json_decode($value['remarks'],true); +// dump($data); + + if ($value['type'] == 3) { + $data[$key]['action'] = '登录 '.($remarks['server_name']?$remarks['server_name']:'无').'-'.($remarks['role_name']?$remarks['role_name']:'无').'-'.($remarks['role_level']?$remarks['role_level']:'无'); + } else if ($value['type'] == 4) { + $data[$key]['action'] = '退出 '.($remarks['server_name']?$remarks['server_name']:'无').'-'.($remarks['role_name']?$remarks['role_name']:'无').'-'.($remarks['role_level']?$remarks['role_level']:'无'); + } + } +// die(); + $count = M('user_action_log','tab_')->where($map)->order('create_time DESC')->count(); $page = set_pagination($count, $row); diff --git a/Data/update.sql b/Data/update.sql index dad48a2bc..08cd275d6 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1376,3 +1376,18 @@ CREATE TABLE `tab_operation_log` ( -- 2020-02-25 chenzhi spend表索引优化 ALTER TABLE `tab_spend` ADD INDEX `game_stayus` (`pay_status`, `pay_game_status`) USING BTREE ; + +-- 2020-02-27 zyx 添加行为日志表 +CREATE TABLE `tab_user_action_log` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `uid` int(11) NOT NULL DEFAULT 0 COMMENT '玩家用户id', + `account` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '玩家用户名', + `game_id` int(11) NOT NULL DEFAULT 0 COMMENT '游戏id', + `game_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '游戏名称', + `action` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '行为详情', + `type` tinyint(2) NOT NULL DEFAULT 0 COMMENT '行为类型 0:修改密码 1:修改/绑定手机号 2:修改身份信息 3:登录 区服-角色-等级 4:退出 区服-角色-等级', + `ip` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT 'ip地址', + `create_time` int(11) NULL DEFAULT 0 COMMENT '创建时间', + `remarks` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic; \ No newline at end of file From e129a044d48c553e7f528cd577db15b1a108bebb Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 27 Feb 2020 10:50:47 +0800 Subject: [PATCH 23/30] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97-?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AuthManagerController.class.php | 56 ++++++++++++++++--- 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/Application/Admin/Controller/AuthManagerController.class.php b/Application/Admin/Controller/AuthManagerController.class.php index 2505fe021..94dd862f8 100644 --- a/Application/Admin/Controller/AuthManagerController.class.php +++ b/Application/Admin/Controller/AuthManagerController.class.php @@ -223,16 +223,24 @@ class AuthManagerController extends AdminController{ addOperationLog(array( "op_type"=>0, "key"=> $_POST['title'], - "url"=>U("User/index") + "url"=>U("AuthManager/index") )); }else{ \Think\Log::actionLog('AuthManager/editGroup','authGroup',1); - addOperationLog(array( - "op_type"=>1, - "key"=> $_POST['title'], - "url"=>U("User/index") - )); $r = $AuthGroup->save(); + //操作日志,不传title表示是访问授权 + $oparr = array( + "op_type"=>1, + "url"=>U("AuthManager/index") + ); + if(empty($_POST['title'])){ + $oparr['key'] = M("AuthGroup")->where("id={$data['id']}")->field("title")->find()['title']; + $oparr['menu'] = "用户-管理组-角色权限-访问授权"; + }else{ + $oparr['key'] =$_POST['title']; + $oparr['menu'] = "用户-管理组-角色权限-基础信息编辑"; + } + addOperationLog($oparr); } if($r===false){ $this->error('操作失败'.$AuthGroup->getError()); @@ -284,7 +292,7 @@ class AuthManagerController extends AdminController{ "op_type"=>$op_type, "key"=> $v['title'], "menu"=>"用户-管理组-角色权限-".$op_name, - "url"=>U("User/index") + "url"=>U("AuthManager/index") )); } } @@ -406,7 +414,22 @@ class AuthManagerController extends AdminController{ if( $gid && !$AuthGroup->checkGroupId($gid)){ $this->error($AuthGroup->error); } - if ( $AuthGroup->addToGroup($uid,$gid) ){ + $flag = false; + try { + $flag = $AuthGroup->addToGroup($uid,$gid); + } catch (\Throwable $th) { + if(empty($AuthGroup->getError())){ + $this->error("操作失败:请确认添加的用户是否存在或已经有归属"); + }else{ + $this->error($AuthGroup->getError()); + } + } + if($flag){ + addOperationLog(array( + "op_type"=>1, + "key"=> M("AuthGroup")->where("id={$gid}")->field("title")->find()['title'], + "url"=>U("AuthManager/index") + )); $this->success('操作成功'); }else{ $this->error($AuthGroup->getError()); @@ -431,6 +454,11 @@ class AuthManagerController extends AdminController{ $this->error('用户组不存在'); } if ( $AuthGroup->removeFromGroup($uid,$gid) ){ + addOperationLog(array( + "op_type"=>1, + "key"=> M("AuthGroup")->where("id={$gid}")->field("title")->find()['title'], + "url"=>U("AuthManager/index") + )); $this->success('操作成功'); }else{ $this->error('操作失败'); @@ -455,6 +483,12 @@ class AuthManagerController extends AdminController{ $this->error($AuthGroup->error); } if ( $AuthGroup->addToCategory($gid,$cid) ){ + //操作日志 + addOperationLog(array( + "op_type"=>1, + "key"=> M("AuthGroup")->where("id={$gid}")->field("title")->find()['title'], + "url"=>U("AuthManager/index") + )); $this->success('操作成功',U('index')); }else{ $this->error('操作失败'); @@ -534,6 +568,12 @@ class AuthManagerController extends AdminController{ 'data_president'=>$promoteData, 'show_data'=>$show_data ))) { + addOperationLog(array( + "op_type"=>1, + "key"=> M("AuthGroup")->where("id={$gid}")->field("title")->find()['title'], + "menu"=>"用户-管理组-角色权限-数据授权", + "url"=>U("AuthManager/index") + )); $this->success('操作成功',U('AuthManager/index')); } else { $this->success('操作成功',U('AuthManager/index')); From 5e794bd78558e7e7a311cd16dfc2f67003622ead Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 27 Feb 2020 13:52:39 +0800 Subject: [PATCH 24/30] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E8=AE=B0=E5=BD=95=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PresidentDepositController.class.php | 48 ++++++++++++++++++- .../Controller/QueryController.class.php | 21 ++++++++ .../StatementMangementController.class.php | 12 +++++ .../Admin/View/UserActionLog/index.html | 4 +- .../Admin/View/UserActionLog/operateLog.html | 4 +- 5 files changed, 84 insertions(+), 5 deletions(-) diff --git a/Application/Admin/Controller/PresidentDepositController.class.php b/Application/Admin/Controller/PresidentDepositController.class.php index 396b32df6..7b5ec904c 100644 --- a/Application/Admin/Controller/PresidentDepositController.class.php +++ b/Application/Admin/Controller/PresidentDepositController.class.php @@ -139,6 +139,9 @@ class PresidentDepositController extends ThinkController 'status_text' => '押金状态', 'pay_confirm_time' => '押金确认时间', ]; + + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出会长押金记录','url'=>U('PresidentDeposit/records'),'menu'=>'推广员-结算单管理-奖罚记录管理-导出会长押金记录']); + data2csv($records, '会长押金记录', $field); exit; } @@ -199,7 +202,9 @@ class PresidentDepositController extends ThinkController $payer = I('payer', ''); $record = M('president_deposit', 'tab_')->where(['promote_id' => $promoteId])->find(); - + + $promoteData = M('promote', 'tab_')->field('account')->where(['id' => $promoteId])->find(); + if (!$record) { if ($payType == 0) { @@ -230,6 +235,9 @@ class PresidentDepositController extends ThinkController $data['create_time'] = time(); $data['update_time'] = time(); M('president_deposit', 'tab_')->add($data); + + addOperationLog(['op_type'=>0,'key'=>$promoteData['account'].$amount,'op_name'=>'新增会长押金','url'=>U('PresidentDeposit/edit',['id'=>$promoteId]),'menu'=>'推广员-结算单管理-奖罚记录管理-新增会长押金']); + return $this->success('保存成功', U('PresidentDeposit/records')); } @@ -262,6 +270,9 @@ class PresidentDepositController extends ThinkController $data['payer'] = $payer; $data['update_time'] = time(); M('president_deposit', 'tab_')->where(['promote_id' => $promoteId])->save($data); + + addOperationLog(['op_type'=>1,'key'=>$promoteData['account'].$amount,'op_name'=>'编辑会长押金','url'=>U('PresidentDeposit/edit',['id'=>$promoteId]),'menu'=>'推广员-结算单管理-会长押金管理-编辑会长押金']); + return $this->success('保存成功'); } @@ -291,6 +302,11 @@ class PresidentDepositController extends ThinkController $data['create_time'] = time(); $data['update_time'] = time(); M('president_deposit', 'tab_')->add($data); + + $promoteData = M('promote', 'tab_')->field('account')->where(['id' => $promoteId])->find(); + + addOperationLog(['op_type'=>1,'key'=>$promoteData['account'],'op_name'=>'编辑无需押金','url'=>U('PresidentDeposit/records'),'menu'=>'推广员-结算单管理-会长押金管理-无需押金']); + } $this->ajaxReturn([ 'status' => 1, @@ -323,6 +339,20 @@ class PresidentDepositController extends ThinkController ]); } + $promoteData = M('promote','tab_') + ->field('account,amount') + ->join('left join tab_president_deposit on tab_president_deposit.promote_id=tab_promote.id') + ->where(['tab_promote.id'=>['in', $promoteIds]]) + ->select(); + +// dump($promoteData);die(); + + foreach ($promoteData as $key => $value) { + if ($value['amount']) { + addOperationLog(['op_type'=>1,'key'=>$value['account'].$value['amount'],'op_name'=>'编辑押金已退款','url'=>U('PresidentDeposit/records'),'menu'=>'推广员-结算单管理-会长押金管理-押金已退款']); + } + + } M('president_deposit', 'tab_')->where(['promote_id' => ['in', $promoteIds]])->save([ 'status' => 2, @@ -358,6 +388,22 @@ class PresidentDepositController extends ThinkController 'message' => '含有非待确认状态记录,不可批量操作' ]); } + + $promoteData = M('promote','tab_') + ->field('account,amount') + ->join('left join tab_president_deposit on tab_president_deposit.promote_id=tab_promote.id') + ->where(['tab_promote.id'=>['in', $promoteIds]]) + ->select(); + +// dump($promoteData);die(); + + foreach ($promoteData as $key => $value) { + if ($value['amount']) { + addOperationLog(['op_type'=>1,'key'=>$value['account'].$value['amount'],'op_name'=>'编辑确认押金到账','url'=>U('PresidentDeposit/records'),'menu'=>'推广员-结算单管理-会长押金管理-确认押金到账']); + } + + } + M('president_deposit', 'tab_')->where(['promote_id' => ['in', $promoteIds]])->save([ 'status' => 1, 'pay_confirm_time' => time(), diff --git a/Application/Admin/Controller/QueryController.class.php b/Application/Admin/Controller/QueryController.class.php index 1d73813ae..867e64a2a 100644 --- a/Application/Admin/Controller/QueryController.class.php +++ b/Application/Admin/Controller/QueryController.class.php @@ -192,6 +192,9 @@ class QueryController extends ThinkController 'selle_ratio' => '分成比例', 'settlement_amount' => '结算金额', ]; + + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出推广结算单','url'=>U('Query/settlement'),'menu'=>'推广员-结算单管理-推广结算']); + data2csv($data,"推广结算", $field); exit; } @@ -296,6 +299,9 @@ class QueryController extends ThinkController 'status_text' => '提现状态', 'respond' => '说明', ]; + + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出推广结算记录','url'=>U('Query/settlement'),'menu'=>'推广员-结算单管理-推广结算']); + data2csv($data,"推广结算", $field); exit; } @@ -1832,6 +1838,21 @@ class QueryController extends ThinkController if ($result === false) { $this->error('操作失败'); } else { + + $promoteAccount = M('promote','tab_')->field('account')->where($map)->select(); + + foreach($promoteAccount as $key => $value) { + + if ($autoStatus == 1) { + $text = '开启自动审核'; + } else { + $text = '关闭自动审核'; + } + + addOperationLog(['op_type'=>1,'key'=>$value['account'],'op_name'=>$text,'url'=>U('Query/autoReview'),'menu'=>'推广员-结算单管理-推广提现-'.$text]); + + } + $this->success('操作成功'); } } else { diff --git a/Application/Admin/Controller/StatementMangementController.class.php b/Application/Admin/Controller/StatementMangementController.class.php index 969440757..07d28ee75 100644 --- a/Application/Admin/Controller/StatementMangementController.class.php +++ b/Application/Admin/Controller/StatementMangementController.class.php @@ -323,12 +323,18 @@ class StatementMangementController extends ThinkController if ($upt === false) { $this->error('保存失败'); } else { + + addOperationLog(['op_type'=>1,'key'=>$data['reward_type'].$data['company_type'].$data['money'],'op_name'=>'修改奖惩记录','url'=>U('Query/settlement'),'menu'=>'推广员-结算单管理-奖罚记录管理']); + $this->success('保存成功', U('StatementMangement/rewardManageList')); } } else { $data['create_time'] = time(); $data['creater_id'] = is_login(); $ins = M('reward_record', 'tab_')->add($data); + + addOperationLog(['op_type'=>0,'key'=>$data['reward_type'].$data['company_type'].$data['money'],'op_name'=>'新增奖惩记录','url'=>U('Query/settlement'),'menu'=>'推广员-结算单管理-奖罚记录管理']); + return $ins ? $this->success('新增成功', U('StatementMangement/rewardManageList')) : $this->error('新增失败'); } } else { @@ -336,7 +342,13 @@ class StatementMangementController extends ThinkController $this->assign('games', $games); if ($id) { if (I('delete')) { + + $rewardRecordData = M('reward_record', 'tab_')->where(['id'=>$id])->find(); + $upt = M('reward_record', 'tab_')->where(['id'=>$id])->delete(); + + addOperationLog(['op_type'=>2,'key'=>$rewardRecordData['reward_type'].$rewardRecordData['company_type'].$rewardRecordData['money'],'op_name'=>'删除奖惩记录','url'=>U('StatementMangement/rewardManageList'),'menu'=>'推广员-结算单管理-奖罚记录管理']); + return $upt ? $this->success('删除成功') : $this->error('删除失败'); } else { $data = M('reward_record', 'tab_')->where(['id'=>$id])->find(); diff --git a/Application/Admin/View/UserActionLog/index.html b/Application/Admin/View/UserActionLog/index.html index e7470e045..91dc73b21 100644 --- a/Application/Admin/View/UserActionLog/index.html +++ b/Application/Admin/View/UserActionLog/index.html @@ -88,7 +88,7 @@ - + @@ -112,7 +112,7 @@ - + diff --git a/Application/Admin/View/UserActionLog/operateLog.html b/Application/Admin/View/UserActionLog/operateLog.html index 3cf5cd8ba..cee7e0839 100644 --- a/Application/Admin/View/UserActionLog/operateLog.html +++ b/Application/Admin/View/UserActionLog/operateLog.html @@ -89,7 +89,7 @@ - + @@ -113,7 +113,7 @@ - + From 9221b1895556262aca94ecf99ae44895709cf30b Mon Sep 17 00:00:00 2001 From: liuweiwen <“529520975@qq.com> Date: Thu, 27 Feb 2020 14:41:51 +0800 Subject: [PATCH 25/30] =?UTF-8?q?=E6=B8=B8=E6=88=8F=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=B1=87=E6=80=BB=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/View/Spend/lists.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Application/Admin/View/Spend/lists.html b/Application/Admin/View/Spend/lists.html index 884ea60a4..8762b8de3 100644 --- a/Application/Admin/View/Spend/lists.html +++ b/Application/Admin/View/Spend/lists.html @@ -260,7 +260,7 @@ - + --> - + +
操作IP地址操作
{$data.account} {$data.create_time|date='Y-m-d H:i:s',###} {$data.ip}删除
操作IP地址操作
{$data.admin_account} {$data.create_time|date='Y-m-d H:i:s',###} {$data.op_ip}删除
汇总 @@ -274,7 +274,8 @@ 昨日充值:昨日平台所有推广员的累计充值(包括官方渠道)
From 5224eec9f28dec14872645820cb9871b44955416 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 27 Feb 2020 15:01:49 +0800 Subject: [PATCH 26/30] =?UTF-8?q?=E4=B8=8A=E6=B8=B8=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E5=8D=95=E7=AE=A1=E7=90=86=E6=97=A5=E5=BF=97=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/PresidentDepositController.class.php | 2 +- Application/Admin/Controller/StatementController.class.php | 6 ++++++ Application/Admin/View/Query/marketList.html | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Application/Admin/Controller/PresidentDepositController.class.php b/Application/Admin/Controller/PresidentDepositController.class.php index 7b5ec904c..3f771d80b 100644 --- a/Application/Admin/Controller/PresidentDepositController.class.php +++ b/Application/Admin/Controller/PresidentDepositController.class.php @@ -140,7 +140,7 @@ class PresidentDepositController extends ThinkController 'pay_confirm_time' => '押金确认时间', ]; - addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出会长押金记录','url'=>U('PresidentDeposit/records'),'menu'=>'推广员-结算单管理-奖罚记录管理-导出会长押金记录']); + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出会长押金记录','url'=>U('PresidentDeposit/records'),'menu'=>'推广员-结算管理-奖罚记录管理-导出会长押金记录']); data2csv($records, '会长押金记录', $field); exit; diff --git a/Application/Admin/Controller/StatementController.class.php b/Application/Admin/Controller/StatementController.class.php index e2a28bf2f..c26264535 100644 --- a/Application/Admin/Controller/StatementController.class.php +++ b/Application/Admin/Controller/StatementController.class.php @@ -319,8 +319,14 @@ class StatementController extends ThinkController "statement_info"=>json_encode($statement_info,JSON_UNESCAPED_UNICODE) ); if($id == 0){ +// var_dump(1);die(); + addOperationLog(['op_type'=>0,'key'=>$company['partner'].getNowDate(),'op_name'=>'新增上游对账单','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-新增上游对账单']); + $res = M("statement","tab_")->add($adddata); }else{ + + addOperationLog(['op_type'=>1,'key'=>$company['partner'].getNowDate(),'op_name'=>'编辑上游对账单','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-编辑上游对账单']); + $res = M("statement","tab_")->where("id = '{$id}'")->save($adddata); } if($res !== false){ diff --git a/Application/Admin/View/Query/marketList.html b/Application/Admin/View/Query/marketList.html index 78188596f..3789f7498 100644 --- a/Application/Admin/View/Query/marketList.html +++ b/Application/Admin/View/Query/marketList.html @@ -169,9 +169,9 @@
- - 导出 - + + + {$_page|default=''}