@ -836,14 +836,41 @@ class FinanceController extends ThinkController
$map['game_player_name'] = array('like',I("user_nickname").'%');
}
// var_dump($map);die();
$field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,user_account,user_nickname,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way";
$field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,user_account,user_nickname,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way,sdk_version ";
$group = "";
$order = "pay_time DESC";
if(isset($_REQUEST['export'])){
$data = D('spend')->getSpendData($map,$field,$group,0,0,$row);
}else{
$data = D('spend')->getSpendData($map,$field,$group,$order,$page,$row);
}
foreach($data as $key => $value) {
$data[$key]['pay_way'] = getPayType($value['pay_way']);
$data[$key]['sdk_version'] =$data[$key]['sdk_version'] == 1 ? "安卓" : "苹果";
$data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']);
}
if(isset($_REQUEST['export'])){
//操作日志
$GetData = $_GET;
unset($GetData['export']);
$dcop = array(
"pay_order_number"=>"支付订单号",
"pay_time"=>"充值时间",
"user_account"=>"玩家账号",
"game_name"=>"游戏名称",
"sdk_version"=>"设备类型",
"promote_account"=>"所属推广员",
"spend_ip"=>"充值ip",
"server_name"=>"游戏区服",
"game_player_name"=>"角色名称",
"cost"=>"订单金额",
"pay_amount"=>"实付金额",
"pay_way"=>"充值方式"
);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U(CONTROLLER_NAME.'/'.ACTION_NAME,$GetData),'menu'=>"充值-财务管理-游戏统计-订单查看-导出"]);
data2csv($data,"游戏统计订单查看",$dcop);
}
$totalData = D('spend')->totalGameStatistics($map, false);
@ -937,7 +964,7 @@ class FinanceController extends ThinkController
}
// var_dump($map);die();
$field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,tab_spend.user_account,
tab_spend.user_nickname,tab_spend.game_name,tab_spend.promote_account,spend_ip,tab_spend.server_name,
tab_spend.user_nickname,tab_spend.game_name,tab_spend.promote_account,spend_ip,tab_spend.server_name,tab_spend.sdk_version,
game_player_name,pay_amount,cost,pay_way";
$group = "";
$order = "pay_time DESC";
@ -950,15 +977,45 @@ class FinanceController extends ThinkController
$join = 'left join tab_user as u on u.id = tab_spend.user_id';
}
if(isset($_REQUEST['export'])){
$data = D('spend')->getSpendData($map, $field2, $group, $order, 0, 0, $join);
}else{
$data = D('spend')->getSpendData($map, $field2, $group, $order, $page, $row, $join);
}
foreach($data as $key => $value) {
$data[$key]['pay_way'] = getPayType($value['pay_way']);
$data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']);
$data[$key]['sdk_version'] =$data[$key]['sdk_version'] == 1 ? "安卓" : "苹果";
$data[$key]['cost'] = number_format($value['cost'],2,'.','');
$data[$key]['pay_amount'] = number_format($value['pay_amount'],2,'.','');
}
if(isset($_REQUEST['export'])){
//操作日志
$GetData = $_GET;
unset($GetData['export']);
$dcop = array(
"pay_order_number"=>"支付订单号",
"pay_time"=>"充值时间",
"user_account"=>"玩家账号",
"game_name"=>"游戏名称",
"sdk_version"=>"设备名称",
"server_name"=>"游戏区服",
"game_player_name"=>"角色名称",
"cost"=>"订单金额",
"pay_amount"=>"实付金额",
"pay_way"=>"充值方式"
);
if ($map['pay_way'] ==-1) {
$title = "内充支出明细";
$dcop["bind_balance"]="绑定币余额";
} elseif ($map['pay_way'] ==0) {//平台币
$title = "平台币直充明细";
$dcop["balance"]="平台币余额";
}
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U(CONTROLLER_NAME.'/'.ACTION_NAME,$GetData),'menu'=>"充值-财务管理-游戏统计-{$title}-导出"]);
data2csv($data,$title,$dcop);
}
$count = D("spend")->getSpendData($map,$field,$group,$order);
$count = count($count);
$page = set_pagination($count,$row);