@ -6511,6 +6511,85 @@ if ($key == 'model'){
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
public function gameStatisticsDetail() {
$game_name = I("game_name");
$xlsName = $game_name . '游戏订单查看';
$xlsCell = array(
array('pay_order_number','支付订单号'),
array('extend','游戏订单号'),
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 (isset($_REQUEST['pay_way'])) {
$map['pay_way'] = $_REQUEST['pay_way'];
}
if (!empty($_REQUEST['pay_order_number'])) {
$map['pay_order_number'] = $_REQUEST['pay_order_number'];
}
if (!empty(I('partner_id'))& & empty(I("game_id"))) {
$wherePartner = I('partner_id');
$gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select();
$gameId = implode(',',array_column($gameId,'id'));
$map['game_id'] = ['in',$gameId];
}
if (!empty(I('timestart'))) {
$timestart = strtotime(I('timestart'));
$map['_string'] = "pay_time > {$timestart}";
}
if (!empty(I('timeend'))) {
$timeend = strtotime(I('timeend'));
$map['_string'] .= " and pay_time < {$timeend}";
}
$map['pay_status'] = 1;
if (!empty(I("game_id"))) {
$map['game_id'] = I("game_id");
}
if (!empty(I('user_account'))) {
$map['user_account'] = array('like','%'.I("user_account").'%');
}
if (!empty(I('user_nickname'))) {
$map['game_player_name'] = array('like',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,extend";
$group = "";
$order = "pay_time DESC";
$xlsData = D('spend')->getSpendData($map,$field,$group,$order);
foreach($xlsData as $key => $value) {
$xlsData[$key]['pay_way'] = getPayType($value['pay_way']);
}
$totalData = D("spend")->totalGameStatistics($map, false);
$sumCash = $totalData['cash_count'] ?? 0;
$sumBalance = $totalData['balance_coin_count'] ?? 0;
$sumInside = $totalData['inside_cash_count'] ?? 0;
$sumAll = $sumCash + $sumBalance + $sumInside;
$sumData = [['pay_order_number'=>'总计:' . $sumAll,
'extend'=>'现金金额:' . $sumCash,
'pay_time'=>'平台币:' . $sumBalance,
'user_account'=>'绑币:' . $sumInside]];
$xlsData = array_merge($xlsData,$sumData);
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
function gameFinanceDetail() {
// set_time_limit(0);