|
|
@ -1084,10 +1084,18 @@ class ExportController extends Controller
|
|
|
|
case 7:
|
|
|
|
case 7:
|
|
|
|
$startDate = empty($_REQUEST['timestart']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['timestart'];
|
|
|
|
$startDate = empty($_REQUEST['timestart']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['timestart'];
|
|
|
|
$endDate = empty($_REQUEST['timeend']) ? date('Y-m-d') : $_REQUEST['timeend'];
|
|
|
|
$endDate = empty($_REQUEST['timeend']) ? date('Y-m-d') : $_REQUEST['timeend'];
|
|
|
|
|
|
|
|
$payStatus = isset($_REQUEST['pay_status']) ? $_REQUEST['pay_status'] : 1;
|
|
|
|
|
|
|
|
|
|
|
|
$startTime = strtotime($startDate);
|
|
|
|
$startTime = strtotime($startDate);
|
|
|
|
$endTime = strtotime($endDate) + 86399;
|
|
|
|
$endTime = strtotime($endDate) + 86399;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($payStatus > 0){
|
|
|
|
$map['pay_time'] = array('BETWEEN', array($startTime, $endTime));
|
|
|
|
$map['pay_time'] = array('BETWEEN', array($startTime, $endTime));
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
$map['spend_time'] = array('BETWEEN', array($startTime, $endTime));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$map['pay_status'] = $payStatus;
|
|
|
|
|
|
|
|
|
|
|
|
$is_sub_data = I("issubdata",0);
|
|
|
|
$is_sub_data = I("issubdata",0);
|
|
|
|
if($is_sub_data == 1){
|
|
|
|
if($is_sub_data == 1){
|
|
|
|
$SpendModel = M("spend","tab_",SUBSITE_DB);
|
|
|
|
$SpendModel = M("spend","tab_",SUBSITE_DB);
|
|
|
@ -1129,10 +1137,7 @@ class ExportController extends Controller
|
|
|
|
$map['extend'] = array('like', trim($_REQUEST['extend']));
|
|
|
|
$map['extend'] = array('like', trim($_REQUEST['extend']));
|
|
|
|
unset($_REQUEST['extend']);
|
|
|
|
unset($_REQUEST['extend']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (isset($_REQUEST['pay_status'])) {
|
|
|
|
|
|
|
|
$map['pay_status'] = $_REQUEST['pay_status'];
|
|
|
|
|
|
|
|
unset($_REQUEST['pay_status']);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isset($_REQUEST['pay_way'])) {
|
|
|
|
if (isset($_REQUEST['pay_way'])) {
|
|
|
|
if ($_REQUEST['pay_way'] == 2) {
|
|
|
|
if ($_REQUEST['pay_way'] == 2) {
|
|
|
|
$map['pay_way'] = ['in', '2,3,4'];
|
|
|
|
$map['pay_way'] = ['in', '2,3,4'];
|
|
|
@ -1205,9 +1210,11 @@ class ExportController extends Controller
|
|
|
|
// $map1 = $map;
|
|
|
|
// $map1 = $map;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
D("Spend")->addSubsiteWhere($map);
|
|
|
|
D("Spend")->addSubsiteWhere($map);
|
|
|
|
|
|
|
|
if($payStatus > 0){
|
|
|
|
$map1 = $map;
|
|
|
|
$map1 = $map;
|
|
|
|
$map1['pay_status'] = 1;
|
|
|
|
$map1['pay_status'] = 1;
|
|
|
|
$total = $SpendModel->where($map1)->sum('pay_amount');
|
|
|
|
$total = $SpendModel->where($map1)->sum('pay_amount');
|
|
|
|
|
|
|
|
}
|
|
|
|
// var_dump($total);die();
|
|
|
|
// var_dump($total);die();
|
|
|
|
$total=$total?$total:0;
|
|
|
|
$total=$total?$total:0;
|
|
|
|
|
|
|
|
|
|
|
@ -1253,6 +1260,7 @@ class ExportController extends Controller
|
|
|
|
|
|
|
|
|
|
|
|
$xlsCell = array_values($headers);
|
|
|
|
$xlsCell = array_values($headers);
|
|
|
|
$fields = array_keys($headers);
|
|
|
|
$fields = array_keys($headers);
|
|
|
|
|
|
|
|
$fields[] = "spend_time";
|
|
|
|
// ----获取游戏的基本信息begin
|
|
|
|
// ----获取游戏的基本信息begin
|
|
|
|
//获取游戏公司
|
|
|
|
//获取游戏公司
|
|
|
|
$cpCompanyDb = M("partner","tab_")->field("id,partner")->order("id asc")->select();
|
|
|
|
$cpCompanyDb = M("partner","tab_")->field("id,partner")->order("id asc")->select();
|
|
|
@ -1313,6 +1321,9 @@ class ExportController extends Controller
|
|
|
|
|
|
|
|
|
|
|
|
foreach($xlsData as $value) {
|
|
|
|
foreach($xlsData as $value) {
|
|
|
|
//游戏信息匹配
|
|
|
|
//游戏信息匹配
|
|
|
|
|
|
|
|
if(!$value['pay_time']) $value['pay_time'] = $value['spend_time'];
|
|
|
|
|
|
|
|
unset($value['spend_time']);
|
|
|
|
|
|
|
|
|
|
|
|
$thisGameInfo = $gameInfo[$value["game_id"]];
|
|
|
|
$thisGameInfo = $gameInfo[$value["game_id"]];
|
|
|
|
$value['game_name'] =$thisGameInfo['relation_game_name'];
|
|
|
|
$value['game_name'] =$thisGameInfo['relation_game_name'];
|
|
|
|
$value['sdk_version'] = $value['sdk_version'] == 1 ? "安卓" : "苹果";
|
|
|
|
$value['sdk_version'] = $value['sdk_version'] == 1 ? "安卓" : "苹果";
|
|
|
|