@ -5391,7 +5391,65 @@ if ($key == 'model'){
$xlsData = array_merge($xlsData,$sumData);
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
function gameFinanceDetail() {
$month = I("count_date");
$xlsName = '充值流水';
$xlsCell = array(
array('pay_order_number','支付订单号'),
array('pay_time','充值时间'),
array('user_account','玩家账号'),
array('game_name','游戏名称'),
array('promote_account','所属推广员'),
array('spend_ip','充值ip'),
array('server_name','游戏区服'),
array('game_player_name','角色名称'),
array('cost','订单金额'),
array('pay_amount','实付金额'),
array('pay_way','充值方式'),
);
if (!empty(I("count_date"))) {
$month = I("count_date");
} else {
$this->error('月份不能为空');
}
$startTime = strtotime(date("Y-m-01",strtotime($month)));
$endTime = strtotime(date("Y-m-t",strtotime($month)));
$map['pay_time'] = array('between',array($startTime,$endTime));
$map['pay_status'] = 1;
if (!empty(I("game_id"))) {
$map['game_id'] = I("game_id");
}
if (!empty(I('user_account'))) {
$map['user_account'] = I("user_account");
}
if (!empty(I('user_nickname'))) {
$map['user_nickname'] = I("user_nickname");
}
$field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,user_account,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way";
$group = "";
$order = "pay_time DESC";
$xlsData = D('spend')->getSpendData($map,$field,$group,$order);
foreach($xlsData as $key => $value) {
$data[$key]['pay_way'] = getPayType($value['pay_way']);
}
$sum = D('spend')->sumSpend($map,'pay_amount');
$sumData = [['pay_order_number'=>'总计',
'pay_way'=>$sum]];
$xlsData = array_merge($xlsData,$sumData);
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
}