Merge branch 'dev' of 47.111.118.107:/srv/git/platform into dev

master
zhanglingsheng 5 years ago
commit 9e44b04586

@ -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;
}

@ -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

@ -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");
}

@ -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','充值时间'),
$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();
$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;
}
$list['platform_selle_ratio'] = $list['selle_ratio'];
if($list['pay_way'] == -1) {
$list['bind_base'] = $list['pay_amount'];
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']];
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);
}
}
$xlsData = $data;
$this->exportExcel($xlsName, $xlsCell, $xlsData,$id);
}
}
public function withdrawRecordExcelInfo($id,$map) {
$xlsName = "提现记录";

@ -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`);
Loading…
Cancel
Save