From ef60ca85cfff474aa571b105a51dffc344582fc1 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Thu, 28 Nov 2019 16:35:26 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Base/Service/PromoteService.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index b42047a94..a8d5e1e7c 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -94,6 +94,7 @@ class PromoteService { $shiftIds = isset($params['shift_ids']) && $params['shift_ids'] ? $params['shift_ids'] : []; $creatorId = isset($params['creator_id']) ? $params['creator_id'] : 0; $creatorType = isset($params['creator_type']) ? $params['creator_type'] : 0; + $remark = isset($params['remark']) ? $params['remark'] : ''; if ($fromPromoteId == $toPromoteId) { return [ @@ -145,6 +146,7 @@ class PromoteService { 'creator_type' => $creatorType, 'status' => 0, 'type' => $type, + 'remark' => $remark, 'shift_ids' => json_encode($shiftIds) ]; @@ -303,6 +305,7 @@ class PromoteService { $fromPromoteId = $task['from_promote_id']; $orderTime = $task['order_time']; $shiftIds = json_decode($task['shift_ids'], true) ?? []; + $remark = $task['remark'] ?? ''; $creator = null; $opAccount = ''; @@ -343,7 +346,7 @@ class PromoteService { 'promote_account' => $fromPromote['account'], 'promote_id_to' => $toPromote['id'], 'promote_account_to' => $toPromote['account'], - 'remark' => $task['creator_type'] == 0 ? '后台补链' : '玩家迁移', + 'remark' => $remark == '' ? ($task['creator_type'] == 0 ? '后台补链' : '玩家迁移') : $remark, 'order_time' => $orderTime, 'create_time' => time(), 'op_id' => $creator ? $creator['id'] : 0, From 14f69c408ed2852f686a5a60db719e39a581db38 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 28 Nov 2019 16:42:12 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E7=99=BB=E5=BD=95=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/ExportController.class.php | 157 ++++++++++++------ 1 file changed, 102 insertions(+), 55 deletions(-) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index dc9e97c15..232938b73 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -3419,80 +3419,127 @@ if ($key == 'model'){ * 登录记录 * @author 鹿文学 */ - public function login_record() { + public function login_record() { - $xlsName = $_REQUEST['xlsname']; + $xlsName = $_REQUEST['xlsname']; - $xlsCell = array( - array('user_account','玩家账号'), - array('game_name','游戏名称'), - array('server_name','游戏区服'), - array('user_nickname','角色名'), - array('login_time','登录时间'), - array('login_ip','最后登录ip'), - ); +// $xlsCell = array( +// array('user_account','玩家账号'), +// array('game_name','游戏名称'), +// array('server_name','游戏区服'), +// array('user_nickname','角色名'), +// array('login_time','登录时间'), +// array('login_ip','最后登录ip'), +// ); + $xlsCell = array( + '玩家账号', + '游戏名称', + '游戏区服', + '角色名', + '登录时间', + '最后登录ip', + ); - if (isset($_REQUEST['login_ip'])) { - $map['login_ip'] = $_REQUEST['login_ip']; - } - if (isset($_REQUEST['game_id'])) { - $map['game_id'] = $_REQUEST['game_id']; - } - if (isset($_REQUEST['game_name'])) { - $map['game_name'] = ['like', $_REQUEST['game_name']."%"]; - unset($_REQUEST['game_name']); - } - if (isset($_REQUEST['game_type'])) { - $map['sdk_version'] = $_REQUEST['game_type']; - unset($_REQUEST['game_type']); - } - if (isset($_REQUEST['server_name'])) { - $map['server_name'] = $_REQUEST['server_name']; - unset($_REQUEST['server_name']); - } - if (isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])) { - $map['login_time'] = array('BETWEEN', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 24 * 60 * 60 - 1)); - }elseif(isset($_REQUEST['timestart'])){ - $map['login_time'] = array('GT',strtotime($_REQUEST['timestart'])); - }elseif(isset($_REQUEST['timeend'])){ - $map['login_time'] = array('lt',(strtotime($_REQUEST['timeend'])+ 24 * 60 * 60 - 1)); - } - if (isset($_REQUEST['account'])) { - $map['user_account'] = array('like', '%' . trim($_REQUEST['account']) . '%'); - } - - $map['login_time'] = array('neq', 0); - $page = intval($_REQUEST['p']); + if (isset($_REQUEST['login_ip'])) { + $map['login_ip'] = $_REQUEST['login_ip']; + } + if (isset($_REQUEST['game_id'])) { + $map['game_id'] = $_REQUEST['game_id']; + } + if (isset($_REQUEST['game_name'])) { + $map['game_name'] = ['like', $_REQUEST['game_name']."%"]; + unset($_REQUEST['game_name']); + } + if (isset($_REQUEST['game_type'])) { + $map['sdk_version'] = $_REQUEST['game_type']; + unset($_REQUEST['game_type']); + } + if (isset($_REQUEST['server_name'])) { + $map['server_name'] = $_REQUEST['server_name']; + unset($_REQUEST['server_name']); + } + if (isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])) { + $map['login_time'] = array('BETWEEN', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 24 * 60 * 60 - 1)); + }elseif(isset($_REQUEST['timestart'])){ + $map['login_time'] = array('GT',strtotime($_REQUEST['timestart'])); + }elseif(isset($_REQUEST['timeend'])){ + $map['login_time'] = array('lt',(strtotime($_REQUEST['timeend'])+ 24 * 60 * 60 - 1)); + } + if (isset($_REQUEST['account'])) { + $map['user_account'] = array('like', '%' . trim($_REQUEST['account']) . '%'); + } - $page = $page?$page:1; +// $map['login_time'] = array('neq', 0); - $row = $_REQUEST['row']?$_REQUEST['row']:10; + $page = intval($_REQUEST['p']); - $data = M('UserLoginRecord','tab_') - ->where($map)->order('id desc')->select(); + $page = $page?$page:1; - $xlsData = []; + $row = $_REQUEST['row']?$_REQUEST['row']:10; - foreach($data as $k => $v) { - $v['login_time'] = date('Y-m-d H:i:s',$v['login_time']); - $v['server_name'] = empty($v['server_name'])?'空':$v['server_name']; + //查询数量 + $accessNum = M('UserLoginRecord','tab_') + ->where($map)->order('id desc')->count(); - $gamename=trim(get_game_name($v['game_id'],'id')); + if ($accessNum > 1000000) { + echo "数据量过大,大于100万";die(); + } - $v['game_name'] = empty($gamename)?($v['type']==2?'APP登录':'平台登录'):$gamename; + $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流中 - $xlsData[] = $v; + $perSize = 50000;//每次查询的条数 + $pages = ceil($accessNum / $perSize); + for($i = 1; $i <= $pages; $i++) { - } + $data = M('UserLoginRecord','tab_') + ->field("user_account,game_name,server_name,user_nickname,login_time,login_ip") + ->where($map) + ->limit(($i-1)*$perSize ,$perSize) + ->order('id desc') + ->select(); + foreach($data as $k => $v) { - $this->exportExcel($xlsName, $xlsCell, $xlsData); + $v['login_time'] = date('Y-m-d H:i:s',$v['login_time']); + $v['server_name'] = empty($v['server_name'])?'空':$v['server_name']; - } +// $gamename=trim(get_game_name($v['game_id'],'id')); + +// $v['game_name'] = empty($gamename)?($v['type']==2?'APP登录':'平台登录'):$gamename; + + $xlsData[] = $v; + + mb_convert_variables('GBK', 'UTF-8', $v); + fputcsv($fp, $v); + } + + unset($xlsData);//释放变量的内存 + //刷新输出缓冲到浏览器 + ob_flush(); + flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。 + } +// $xlsData = []; + + exit(); + + +// $this->exportExcel($xlsName, $xlsCell, $xlsData); + + } /** From ce86f56cc59c80dac5dd03729a7b3d1bd78fa503 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 28 Nov 2019 16:57:11 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86->=E5=85=85=E5=80=BC?= =?UTF-8?q?=E7=8E=A9=E5=AE=B6--=E6=97=B6=E9=97=B4=E6=A3=80=E7=B4=A2?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/QueryController.class.php | 4 ++-- Application/Home/View/default/Query/userRecharges.html | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 75979e442..75b7bc1c5 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1728,7 +1728,7 @@ class QueryController extends BaseController $begTime = strtotime($initBegTime); $endTime = strtotime($initEndTime); $endTime += 3600 * 24; - $nowTime = strtotime(date('Y-m-d 00:00:00', time())); + $nowTime = strtotime($nowTime); $promote = $this->getLoginPromote(); $levelPromote = $this->getLevelPromote(); @@ -1843,7 +1843,7 @@ class QueryController extends BaseController $this->assign('initBegTime', $initBegTime); $this->assign('initEndTime', $initEndTime); $this->assign('sort', $sort); - $this->assign('setdate', $nowTime); + $this->assign('setdate', date('Y-m-d', $nowTime)); $this->display('userRecharges'); } diff --git a/Application/Home/View/default/Query/userRecharges.html b/Application/Home/View/default/Query/userRecharges.html index abc69c383..98b80d789 100644 --- a/Application/Home/View/default/Query/userRecharges.html +++ b/Application/Home/View/default/Query/userRecharges.html @@ -123,7 +123,7 @@ - 今日充值 + 昨日充值 @@ -201,6 +201,7 @@ $(function(){ $(".select_gallery").select2(); var date = "{$setdate}"; + console.log(date); $('#sdate').datetimepicker({ format: 'yyyy-mm-dd', language: "zh-CN", From 9e9cff0ba37a29f9b57bcddc57c0e39a92d29b7f Mon Sep 17 00:00:00 2001 From: chenzhi <“chenzhi063@qq.com> Date: Thu, 28 Nov 2019 16:58:33 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=87=E5=88=86?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/update.sql | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Data/update.sql b/Data/update.sql index 9fe8233fb..924ff99c5 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -595,4 +595,17 @@ CHANGE COLUMN `create_promote_id` `creator_id` int(11) NOT NULL DEFAULT 0 COMMEN ALTER TABLE `sys_shift_task` ADD COLUMN `creator_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '创建者类型 0 后台管理员 1 推广员' AFTER `creator_id`; ALTER TABLE `tab_mend` -ADD COLUMN `op_type` tinyint(0) NOT NULL DEFAULT 0 COMMENT '0 管理员 1 推广员' AFTER `op_account`; \ No newline at end of file +ADD COLUMN `op_type` tinyint(0) NOT NULL DEFAULT 0 COMMENT '0 管理员 1 推广员' AFTER `op_account`; + +--补链新增切分时间 chenzhi +UPDATE `sys_model` SET `list_grid` = 'id:编号 +user_account:账号 +user_nickname:昵称 +promote_id:推广员编号 +promote_account:推广员账号 +promote_id_to:修改后编号 +promote_account_to:修改后账号 +remark:备注 +create_time:时间 +op_account:操作人账号 +order_time:切分时间' WHERE `id` = 29; \ No newline at end of file From 81e56063c7bfbe524ec119e3d7e8b280bf8f00a9 Mon Sep 17 00:00:00 2001 From: chenzhi <“chenzhi063@qq.com> Date: Thu, 28 Nov 2019 17:11:21 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E8=A1=A5=E9=93=BE=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/MendController.class.php | 4 ++-- Application/Admin/View/Mend/shiftInfo.html | 22 +++++++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Application/Admin/Controller/MendController.class.php b/Application/Admin/Controller/MendController.class.php index 16625e9d8..b4a22e062 100644 --- a/Application/Admin/Controller/MendController.class.php +++ b/Application/Admin/Controller/MendController.class.php @@ -132,9 +132,9 @@ class MendController extends ThinkController { $id = I('id'); $status = M('ShiftTask')->where(['id' => $id,'status' => 0])->save(['status' => 2]); if ($status) { - $this->success('取消补链成功', U('lists'), 2); + $this->ajaxReturn(array("status"=>1,"url"=> U('lists'))); } else { - $this->error("取消失败,或补链已生效",U('lists')); + $this->ajaxReturn(array("status"=>0,"url"=> U('lists'))); } } } diff --git a/Application/Admin/View/Mend/shiftInfo.html b/Application/Admin/View/Mend/shiftInfo.html index 768d1bd5c..050614e98 100644 --- a/Application/Admin/View/Mend/shiftInfo.html +++ b/Application/Admin/View/Mend/shiftInfo.html @@ -130,6 +130,7 @@ +