@ -92,7 +92,7 @@ class FinancePromoteController extends AdminController
"bind_coin_count"=>"内充支出",
"bind_coin_count"=>"内充支出",
"inside_cash_count"=>"平台币内充",
"inside_cash_count"=>"平台币内充",
"allcount"=>"渠道游戏内充值合计"
"allcount"=>"渠道游戏内充值合计"
));die();
));
}
}
$this->assign('list_data', $data);
$this->assign('list_data', $data);
$this->assign('all_count', $count);
$this->assign('all_count', $count);
@ -235,10 +235,22 @@ class FinancePromoteController extends AdminController
}
}
$data = my_sort($data, $data_order_type, (int)$data_order);
$data = my_sort($data, $data_order_type, (int)$data_order);
if(isset($_REQUEST['export'])){
data2csv($data,'渠道统计',array(
"company_name"=>"推广公司",
"promote_account"=>"推广员账号",
"cash_count"=>"游戏现金金额",
"balance_coin_count"=>"平台币直充支出",
"bind_coin_count"=>"内充支出",
"inside_cash_count"=>"平台币内充",
"allcount"=>"渠道游戏内充值合计"
));
}
$size = $row;
$size = $row;
$data = array_slice($data, ($arraypage - 1) * $size, $size);
$data = array_slice($data, ($arraypage - 1) * $size, $size);
$this->assign('all_count', $allcount);
$this->assign('all_count', $allcount);
$this->assign('list_data', $data);
$this->assign('list_data', $data);
$this->meta_title = '渠道统计';
$this->display();
$this->display();
// dump($senddata);
// dump($senddata);
@ -334,8 +346,28 @@ class FinancePromoteController extends AdminController
//游戏统计列表
//游戏统计列表
$data =self::gameStatisticsData($map, $row, $p);
$data =self::gameStatisticsData($map, $row, $p);
foreach ($data as $key => $value) {
if(isset($_REQUEST['export'])){
$data[$key]['all_cash_count'] = $value['cash_count'] + $value['balance_coin_count'] + $value['inside_cash_count'];
$data =self::gameStatisticsData($map);
}else {
$data =self::gameStatisticsData($map, $row, $p);
}
foreach ($data as $key => & $value) {
$value['cash_count']?:0;
$value['balance_coin_count']?:0;
$value['inside_cash_count']?:0;
$value['all_cash_count'] = $value['cash_count'] + $value['balance_coin_count'] + $value['inside_cash_count'];
if(!$value['partner_name']) $value['partner_name'] = "无";
if(!$value['game_name']) $value['game_name'] = "无";
}
if (isset($_REQUEST['export'])) {
data2csv($data,'游戏统计', array(
"partner_name"=>"合作公司",
"game_name"=>"游戏",
"cash_count"=>"游戏现金金额",
"balance_coin_count"=>"平台币直充支出",
"inside_cash_count"=>"内充支出",
"all_cash_count"=>"游戏内充值合计"
));
}
}
$allData = self::gameStatisticsData($map);//列表总数
$allData = self::gameStatisticsData($map);//列表总数
@ -358,7 +390,7 @@ class FinancePromoteController extends AdminController
$this->assign('sumInside', $sumInside);
$this->assign('sumInside', $sumInside);
$this->assign('sumAll', $sumAll);
$this->assign('sumAll', $sumAll);
$this->assign('data',$data);
$this->assign('data',$data);
$this->meta_title = '游戏统计';
$this->display();
$this->display();
}
}
//游戏订单详情
//游戏订单详情
@ -450,11 +482,29 @@ class FinancePromoteController extends AdminController
$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";
$group = "";
$group = "";
$order = "pay_time DESC";
$order = "pay_time DESC";
$data = D('spend')->getSpendData($map,$field,$group,$order,$page,$row);
if(isset($_REQUEST['export'])){
$data = D('spend')->getSpendData($map,$field,$group,$order);
}else {
$data = D('spend')->getSpendData($map,$field,$group,$order,$page,$row);
}
foreach($data as $key => $value) {
foreach($data as $key => $value) {
$data[$key]['pay_way'] = getPayType($value['pay_way']);
$data[$key]['pay_way'] = getPayType($value['pay_way']);
}
}
if (isset($_REQUEST['export'])) {
data2csv($data,'游戏订单查看', array(
"pay_order_number"=>"支付订单号",
"pay_time"=>"充值时间",
"user_account"=>"玩家账号",
"game_name"=>"游戏名称",
"promote_account"=>"所属推广员",
"spend_ip"=>"充值ip",
"server_name"=>"游戏区服",
"game_player_name"=>"角色名称",
"cost"=>"订单金额",
"pay_amount"=>"实付金额",
"pay_way"=>"充值方式",
));
}
$totalData = self::totalGameStatisticsData($map, false);
$totalData = self::totalGameStatisticsData($map, false);
$sumCash = $totalData['cash_count'] ?? 0;
$sumCash = $totalData['cash_count'] ?? 0;
$sumBalance = $totalData['balance_coin_count'] ?? 0;
$sumBalance = $totalData['balance_coin_count'] ?? 0;
@ -490,7 +540,7 @@ class FinancePromoteController extends AdminController
->join('LEFT JOIN tab_partner as p ON g.partner_id=p.id')
->join('LEFT JOIN tab_partner as p ON g.partner_id=p.id')
->where($map)
->where($map)
->group('s.game_id');
->group('s.game_id');
if ($row) {
if ($row != 0 ) {
$query = $query->page($page,$row);
$query = $query->page($page,$row);
}
}
$data = $query->select();
$data = $query->select();
@ -587,13 +637,37 @@ class FinancePromoteController extends AdminController
$field2 = $field . ',balance';
$field2 = $field . ',balance';
$join = 'left join tab_user as u on u.id = tab_spend.user_id';
$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, $page, $row, $join);
$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) {
foreach($data as $key => $value) {
$data[$key]['pay_way'] = getPayType($value['pay_way']);
$data[$key]['pay_way'] = getPayType($value['pay_way']);
}
}
if (isset($_REQUEST['export'])) {
$field = array(
"pay_order_number"=>"支付订单号",
"pay_time"=>"充值时间",
"user_account"=>"玩家账号",
"game_name"=>"游戏名称",
"server_name"=>"游戏区服",
"game_player_name"=>"角色名称",
"cost"=>"订单金额",
"pay_amount"=>"实付金额",
"pay_way"=>"充值方式"
);
if ($map['pay_way'] ==-1) {
$field["bind_balance"] = "绑定币余额";
$title = "内充支出明细";
} elseif ($map['pay_way'] ==0) {
$field["balance"] = "平台币余额";
$title = "平台币直充明细";
}
data2csv($data,$title,$field);
}
$count = D("spend")->getSpendData($map,$field,$group,$order);
$count = D("spend")->getSpendData($map,$field,$group,$order);
$count = count($count);
$count = count($count);
$page = set_pagination($count,$row);
$page = set_pagination($count,$row);