From bcc0b964b03add29b84ec73647b9c7d33340d757 Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Tue, 26 Nov 2019 10:13:18 +0800 Subject: [PATCH 1/5] upt --- Application/Admin/Controller/PromoteController.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index 570c257a6..d8bd0a3e7 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -66,6 +66,11 @@ unset($_REQUEST['parent_id']); if (I('status') || I('status', -1) == 0) { $map['status'] = I('status'); } + + if (I('ver_status') || I('ver_status', -1) == 0) { + $map['ver_status'] = I('ver_status'); + } + if (I("promote_level")) { $map['level'] = I("promote_level"); } From be33c5c47153a3e32ccb80b994b5f6ffd8c04247 Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Tue, 26 Nov 2019 10:30:02 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 14903a25e..db74baa9a 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -254,13 +254,15 @@ function all_pay_way($type=false) $pay_way[1]=array('key'=>-1,'value'=>"绑币"); $pay_way[2]=array('key'=>1,'value'=>"支付宝"); $pay_way[3]=array('key'=>2,'value'=>"微信"); + $pay_way[7]=array('key'=>8,'value'=>'金猪'); + $pay_way[9]=array('key'=>9,'value'=>"双乾支付-支付宝"); + $pay_way[10]=array('key'=>10,'value'=>"双乾支付-银联"); // $pay_way[3]=array('key'=>3,'value'=>'微信APP'); // $pay_way[4]=array('key'=>4,'value'=>'威富通'); /* $pay_way[4]=array('key'=>5,'value'=>'聚宝云'); */ // $pay_way[5]=array('key'=>6,'value'=>'汇付宝'); /* $pay_way[6]=array('key'=>7,'value'=>"苹果支付"); */ - $pay_way[7]=array('key'=>8,'value'=>'金猪'); $pay_way[15]=array('key'=>15,'value'=>'双乾支付-快捷'); return $pay_way; } From d5bc6be41ea8de201372f8be0c452dca2d64cf8d Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Tue, 26 Nov 2019 10:42:10 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E7=8E=A9=E5=AE=B6=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1=E8=A1=A8=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/update.sql | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/Data/update.sql b/Data/update.sql index 024e18c0e..744eec335 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -510,25 +510,21 @@ ADD INDEX `widthdraw_number`(`widthdraw_number`); --玩家角色数据统计表 CREATE TABLE `tab_user_play_data_count` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `game_id` int(11) NOT NULL DEFAULT '0' COMMENT '游戏id', + `user_id` int(11) NOT NULL DEFAULT 0 COMMENT '玩家ID', + `promote_id` int(11) NOT NULL DEFAULT 0 COMMENT '推广员ID', + `game_id` int(11) NOT NULL DEFAULT 0 COMMENT '游戏id', `server_id` varchar(255) NOT NULL COMMENT '区服id', `role_id` varchar(255) NOT NULL COMMENT '角色id', `recharge_cost` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '充值总额', - `recharge_count` int(10) NOT NULL DEFAULT '0' COMMENT '充值次数', - `create_time` int(10) NOT NULL DEFAULT '0' COMMENT '创建时间', + `recharge_count` int(10) NOT NULL DEFAULT 0 COMMENT '充值次数', + `create_time` int(10) NOT NULL DEFAULT 0 COMMENT '创建时间', PRIMARY KEY (`id`), KEY `recharge_cost` (`recharge_cost`) USING BTREE, KEY `recharge_count` (`recharge_count`) USING BTREE, - KEY `search` (`game_id`,`server_id`,`role_id`) USING BTREE, - KEY `create_time` (`create_time`) USING BTREE + KEY `create_time` (`create_time`) USING BTREE, + KEY `search` (`user_id`,`promote_id`,`game_id`,`server_id`,`role_id`,`create_time`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; -ALTER TABLE `tab_user_play_data_count` -ADD INDEX `search`(`game_id`, `server_id`, `role_id`, `create_time`) USING BTREE, -ADD INDEX `create_time`(`create_time`) USING BTREE; -ADD INDEX `recharge_cost`(`recharge_cost`) USING BTREE, -ADD INDEX `recharge_count`(`recharge_count`) USING BTREE; - --身份证认证信息 CREATE TABLE `tab_idcard_log` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -551,15 +547,6 @@ ADD COLUMN `spend_ids` longtext NOT NULL COMMENT '充值订单id'; ALTER TABLE `tab_promote` ADD COLUMN`oa_associated` tinyint(1) DEFAULT '0' COMMENT 'oa是否关联', ---玩家角色数据统计表--添加玩家ID和推广员ID -ALTER TABLE `tab_user_play_data_count` -ADD COLUMN `user_id` int(11) NOT NULL DEFAULT 0 COMMENT '玩家ID', -ADD COLUMN `promote_id` int(11) NOT NULL DEFAULT 0 COMMENT '推广员ID'; - -ALTER TABLE `tab_user_play_data_count` -DROP INDEX `search`, -ADD INDEX `search`(`user_id`, `promote_id`, `game_id`, `server_id`, `role_id`, `create_time`) USING BTREE; - --玩家角色表--添加索引 ALTER TABLE `tab_user_play_info` ADD INDEX `game_id`(`game_id`, `server_id`, `role_id`); \ No newline at end of file From 5b53fb6287ca706757af5711a5f4d4336b11b771 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Tue, 26 Nov 2019 13:47:58 +0800 Subject: [PATCH 4/5] exit --- .../Controller/DownloadController.class.php | 110 +++++++++++------- 1 file changed, 70 insertions(+), 40 deletions(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 07e77e5e9..5110df893 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -48,6 +48,7 @@ class DownloadController extends BaseController { $cellNum = count($expCellName); $dataNum = count($expTableData); Vendor("PHPExcel.PHPExcel"); + $objPHPExcel = new \PHPExcel(); $cellName = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY', 'AZ'); $objPHPExcel->getActiveSheet(0)->mergeCells('A1:' . $cellName[$cellNum - 1] . '1');//合并单元格 @@ -57,10 +58,11 @@ class DownloadController extends BaseController { $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellName[$i] . '2', $expCellName[$i][1]); } for ($i = 0; $i < $dataNum; $i++) { - for ($j = 0; $j < $cellNum; $j++) { - $objPHPExcel->getActiveSheet(0)->setCellValue($cellName[$j] . ($i + 3), $expTableData[$i][$expCellName[$j][0]]); - } + for ($j = 0; $j < $cellNum; $j++) { + $objPHPExcel->getActiveSheet(0)->setCellValue($cellName[$j] . ($i + 3), $expTableData[$i][$expCellName[$j][0]]); + } } + ob_end_clean();//清除缓冲区,避免乱码 header('pragma:public'); header('Content-type:application/vnd.ms-excel;charset=utf-8;name="' . $xlsTitle . '.xls"'); @@ -2356,34 +2358,35 @@ class DownloadController extends BaseController { } public function withdrawDtlExcelInfo($id,$map) { - $xlsName = "提现记录"; - $xlsCell = array( - array('pay_order_number','充值订单号'), - array('game_name','游戏'), - array('sdk_version','平台'), - array('user_account','玩家账号'), - array('pay_amount','订单总额'), - array('cash_base','现金分成基数'), - array('selle_ratio','现金分成比例'), - array('platform_base','平台币分成基数'), - array('selle_ratio','平台币分成比例'), - array('bind_base','绑定币分成基数'), - array('selle_ratio','绑定币分成比例'), - array('pay_way_name','现金支付通道'), - array('income','收益'), - array('status','订单状态'), - array('pay_time','充值时间'), - ); - $spendModel = M('spend', 'tab_'); - $withdrawId = $map['withdraw_id']; - $withdraw = M('withdraw', 'tab_')->field('promote_id,status')->where(array('id' => $withdrawId))->find(); + $xlsName = "提现记录"; + $xlsCell = array( + '充值订单号', + '游戏', + '平台', + '玩家账号', + '订单总额', + '充值时间', + '收益', + '现金支付通道', + '现金分成基数', + '现金分成比例', + '平台币分成基数', + '平台币分成比例', + '绑定币分成基数', + '绑定币分成比例', + '订单状态', + ); + $xlsCell1 = $xlsCell; + $spendModel = M('spend', 'tab_'); + $withdrawId = $map['withdraw_id']; + $withdraw = M('withdraw', 'tab_')->field('promote_id,status')->where(array('id' => $withdrawId))->find(); $data = $spendModel - ->field('id,pay_order_number,game_name,sdk_version,user_account,pay_amount,pay_way,selle_ratio,pay_time') + ->field('pay_order_number,game_name,sdk_version,user_account,pay_amount,pay_way,selle_ratio,pay_time') ->where($map) ->order('id desc') ->select(); - if (!empty($data)) { - foreach ($data as &$list) { + if (!empty($data)) { + foreach ($data as $key => &$list) { $list['income'] = bcmul($list['pay_amount'], bcdiv($list['selle_ratio'], 100, 2), 2); $list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']); switch ($list['pay_way']) { @@ -2401,27 +2404,54 @@ class DownloadController extends BaseController { }else { $list['cash_base'] = 0; } - + $list['cash_selle_ratio'] = $list['selle_ratio']; if($list['pay_way'] == 0) { - $list['platform_base'] = $list['pay_amount']; + $list['platform_base'] = $list['pay_amount']; }else { $list['platform_base'] = 0; } - - if($list['pay_way'] == -1) { - $list['bind_base'] = $list['pay_amount']; + $list['platform_selle_ratio'] = $list['selle_ratio']; + + if($list['pay_way'] == -1) { + $list['bind_base'] = $list['pay_amount']; }else { $list['bind_base'] = 0; } - + $list['bind_selle_ratio'] = $list['selle_ratio']; + $list['status'] = FinanceController::$withdrawStatus[$withdraw['status']]; - - - } - } - $xlsData = $data; - $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); - } + unset($list['pay_way']); + unset($list['selle_ratio']); + } + } + $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('gb2312', 'UTF-8', $xlsCell); + fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 + $accessNum = '100000';//从数据库获取总量,假设是十万 + $accessNum = count($data)?:0 ; + + $perSize = 5000;//每次查询的条数 + $pages = ceil($accessNum / $perSize); + for($i = 1; $i <= $pages - 1; $i++) { + foreach($data as $value) { + mb_convert_variables('GBK', 'UTF-8', $value); + fputcsv($fp, $value); + } + unset($data); + ob_flush(); + flush(); + } + fclose($fp); + + } public function withdrawRecordExcelInfo($id,$map) { $xlsName = "提现记录"; From 12fb156306badbfbe1d9e63d024c1f62db9c7dd9 Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Tue, 26 Nov 2019 14:34:35 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/ConsoleController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Admin/Controller/ConsoleController.class.php b/Application/Admin/Controller/ConsoleController.class.php index ef8cbb65f..9ccebc9f9 100644 --- a/Application/Admin/Controller/ConsoleController.class.php +++ b/Application/Admin/Controller/ConsoleController.class.php @@ -94,7 +94,7 @@ class ConsoleController extends Think { */ public function modifyLogin() { - $start_time = $current_time = strtotime(date("Y-m-d")); + $start_time = $current_time = strtotime(date("Y-m-d"))-86400; for ($i=$start_time; $i<=$current_time; $i+=86400) { $end_time = $i+86400; $result = M()->query("SELECT