|
|
|
@ -2031,16 +2031,17 @@ class DownloadController extends BaseController {
|
|
|
|
|
array('new_device_num','新创角设备'),
|
|
|
|
|
array('new_ip_num','新增创角ip'),
|
|
|
|
|
array('login_user_num','登陆用户数'),
|
|
|
|
|
array('spend_user_num','充值人数'),
|
|
|
|
|
array('spend_num','充值次数'),
|
|
|
|
|
array('spend_all_amount','充值总额'),
|
|
|
|
|
array('spend_cash','现金充值'),
|
|
|
|
|
array('spend_generic','通用币充值'),
|
|
|
|
|
array('spend_binding','绑定币充值'),
|
|
|
|
|
array('spend_discount','折扣币充值'),
|
|
|
|
|
array('spend_voucher','代金券使用'),
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|
if($this->canViewUserRecharge) {
|
|
|
|
|
$xlsCell[] = array('spend_user_num','充值人数');
|
|
|
|
|
$xlsCell[] = array('spend_num','充值次数');
|
|
|
|
|
$xlsCell[] = array('spend_all_amount','充值总额');
|
|
|
|
|
$xlsCell[] = array('spend_cash','现金充值');
|
|
|
|
|
$xlsCell[] = array('spend_generic','通用币充值');
|
|
|
|
|
$xlsCell[] = array('spend_binding','绑定币充值');
|
|
|
|
|
$xlsCell[] = array('spend_discount','折扣币充值');
|
|
|
|
|
$xlsCell[] = array('spend_voucher','代金券使用');
|
|
|
|
|
}
|
|
|
|
|
if(!empty($map['tab_apply.promote_id'][1])) {
|
|
|
|
|
$params['promote_ids'] = $map['tab_apply.promote_id'][1];
|
|
|
|
|
}
|
|
|
|
@ -2136,6 +2137,16 @@ class DownloadController extends BaseController {
|
|
|
|
|
$allData['new_device_num'] = $userRepository->getNewCreateRoleDeviceCountByGame($params);//新创角设备
|
|
|
|
|
$allData['new_ip_num'] = $userRepository->getNewCreateRoleIpCountByGame($params);//新创角IP
|
|
|
|
|
$allData['login_user_num'] = $userRepository->getLoginCountGroupByGame($params);//登录用户数
|
|
|
|
|
|
|
|
|
|
if($this->canViewUserRecharge) {
|
|
|
|
|
$record['spend_user_num'] = $spendUserNumList[$gameId];
|
|
|
|
|
$record['spend_num'] = $spendNumList[$gameId];
|
|
|
|
|
$record['spend_all_amount'] = $spendAllAmountList[$gameId];
|
|
|
|
|
$record['spend_cash'] = $spendCashList[$gameId];
|
|
|
|
|
$record['spend_generic'] = $spendGenericList[$gameId];
|
|
|
|
|
$record['spend_binding'] = $spendBindingList[$gameId];
|
|
|
|
|
$record['spend_discount'] = 0;
|
|
|
|
|
$record['spend_voucher'] = 0;
|
|
|
|
|
$allData['spend_user_num'] = $spendRepository->getPayUserCountByGame($params);//充值人数
|
|
|
|
|
$allData['spend_num'] = $spendRepository->getPayCountByGame($params);//充值次数
|
|
|
|
|
unset($params['pay_way']);
|
|
|
|
@ -2148,6 +2159,9 @@ class DownloadController extends BaseController {
|
|
|
|
|
$allData['spend_binding'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//绑定币充值
|
|
|
|
|
$allData['spend_discount'] = '0.00';
|
|
|
|
|
$allData['spend_voucher'] = '0.00';
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
$records[] = $record;
|
|
|
|
|
$records[] = $allData;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -2895,16 +2909,19 @@ class DownloadController extends BaseController {
|
|
|
|
|
array('new_device_num','新创角设备'),
|
|
|
|
|
array('new_ip_num','新增创角IP'),
|
|
|
|
|
array('login_user_num','登陆用户数'),
|
|
|
|
|
array('spend_user_num','充值人数'),
|
|
|
|
|
array('spend_num','充值次数'),
|
|
|
|
|
array('spend_all_amount','充值总额'),
|
|
|
|
|
array('spend_cash','现金充值'),
|
|
|
|
|
array('spend_generic','通用币充值'),
|
|
|
|
|
array('spend_binding','绑定币充值'),
|
|
|
|
|
array('spend_discount','折扣币充值'),
|
|
|
|
|
array('spend_voucher','代金劵使用'),
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if ($this->canViewUserRecharge) {
|
|
|
|
|
$xlsCell[] = array('spend_user_num','充值人数');
|
|
|
|
|
$xlsCell[] = array('spend_num','充值次数');
|
|
|
|
|
$xlsCell[] = array('spend_all_amount','充值总额');
|
|
|
|
|
$xlsCell[] = array('spend_cash','现金充值');
|
|
|
|
|
$xlsCell[] = array('spend_generic','通用币充值');
|
|
|
|
|
$xlsCell[] = array('spend_binding','绑定币充值');
|
|
|
|
|
$xlsCell[] = array('spend_discount','折扣币充值');
|
|
|
|
|
$xlsCell[] = array('spend_voucher','代金劵使用');
|
|
|
|
|
}
|
|
|
|
|
$nowTime = date('Y-m-d');
|
|
|
|
|
$initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
|
|
|
|
|
$initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime');
|
|
|
|
@ -2933,7 +2950,6 @@ class DownloadController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
$params['dayList'] = $map["dayList"];
|
|
|
|
|
$summaryData = [];
|
|
|
|
|
$records = [];
|
|
|
|
|
if (intval($endTime - $begTime) / (24 * 3600) <= 30) {
|
|
|
|
|
$userRepository = new UserRepository();
|
|
|
|
|
$spendRepository = new SpendRepository();
|
|
|
|
@ -2958,6 +2974,7 @@ class DownloadController extends BaseController {
|
|
|
|
|
$allData['new_device_num'] = 0;
|
|
|
|
|
$allData['new_ip_num'] = 0;
|
|
|
|
|
$allData['login_user_num'] = 0;
|
|
|
|
|
if($this->canViewUserRecharge) {
|
|
|
|
|
$allData['spend_user_num'] = 0;
|
|
|
|
|
$allData['spend_num'] = 0;
|
|
|
|
|
$allData['spend_all_amount'] = 0;
|
|
|
|
@ -2966,6 +2983,7 @@ class DownloadController extends BaseController {
|
|
|
|
|
$allData['spend_binding'] = 0;
|
|
|
|
|
$allData['spend_discount'] = 0;
|
|
|
|
|
$allData['spend_voucher'] = 0;
|
|
|
|
|
}
|
|
|
|
|
foreach ($params['dayList'] as $day) {
|
|
|
|
|
$date = date('Ymd', strtotime($day));
|
|
|
|
|
$records[] = [
|
|
|
|
@ -2991,6 +3009,15 @@ class DownloadController extends BaseController {
|
|
|
|
|
$allData['new_device_num'] += $newDeviceNumList[$day];
|
|
|
|
|
$allData['new_ip_num'] += $newIpNumList[$day];
|
|
|
|
|
$allData['login_user_num'] += $loginUserNumList[$day];
|
|
|
|
|
if ($this->canViewUserRecharge) {
|
|
|
|
|
$record['spend_user_num'] = $spendUserNumList[$day];
|
|
|
|
|
$record['spend_num'] = $spendNumList[$day];
|
|
|
|
|
$record['spend_all_amount'] = $$spendAllAmountList[$day];
|
|
|
|
|
$record['spend_cash'] = $spendCashList[$day];
|
|
|
|
|
$record['spend_generic'] = $spendGenericList[$day];
|
|
|
|
|
$record['spend_binding'] = $spendBindingList[$day];
|
|
|
|
|
$record['spend_discount'] = 0;
|
|
|
|
|
$record['spend_voucher'] = 0;
|
|
|
|
|
$allData['spend_user_num'] += $spendUserNumList[$day];
|
|
|
|
|
$allData['spend_num'] += $spendNumList[$day];
|
|
|
|
|
$allData['spend_all_amount'] = bcadd($allData['spend_all_amount'], $spendAllAmountList[$day], 2);
|
|
|
|
@ -2999,6 +3026,8 @@ class DownloadController extends BaseController {
|
|
|
|
|
$allData['spend_binding'] = bcadd($allData['spend_binding'], $spendBindingList[$day], 2);
|
|
|
|
|
$allData['spend_discount'] = bcadd($allData['spend_discount'], 0, 2);
|
|
|
|
|
$allData['spend_voucher'] = bcadd($allData['spend_voucher'], 0, 2);
|
|
|
|
|
}
|
|
|
|
|
$records[] = $record;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
$allData['day'] = '合计';
|
|
|
|
@ -3024,15 +3053,15 @@ class DownloadController extends BaseController {
|
|
|
|
|
array('new_create_role_user_count','新创角用户'),
|
|
|
|
|
array('new_create_role_ip_count','新创角ip'),
|
|
|
|
|
array('login_user_count','登陆用户数'),
|
|
|
|
|
array('recharge_user_count','充值人数'),
|
|
|
|
|
array('recharge_count','充值次数'),
|
|
|
|
|
array('recharge_amount','充值总额'),
|
|
|
|
|
array('recharge_by_ban_coin','绑定币充值'),
|
|
|
|
|
array('recharge_by_coin','通用币充值'),
|
|
|
|
|
array('recharge_by_cash','现金充值'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|
if ($this->canViewUserRecharge) {
|
|
|
|
|
$xlsCell[] = array('recharge_user_count','充值人数');
|
|
|
|
|
$xlsCell[] = array('recharge_count','充值次数');
|
|
|
|
|
$xlsCell[] = array('recharge_amount','充值总额');
|
|
|
|
|
$xlsCell[] = array('recharge_by_ban_coin','绑定币充值');
|
|
|
|
|
$xlsCell[] = array('recharge_by_coin','通用币充值');
|
|
|
|
|
$xlsCell[] = array('recharge_by_cash','现金充值');
|
|
|
|
|
}
|
|
|
|
|
$params['isContainSubs'] = $map['isContainSubs'];
|
|
|
|
|
$params['basicPromotes'] = json_decode($map['basicPromotes'],TRUE);
|
|
|
|
|
$ids = $map['ids'];
|
|
|
|
@ -3068,9 +3097,16 @@ class DownloadController extends BaseController {
|
|
|
|
|
$newCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds($ids, $params);
|
|
|
|
|
$newCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds($ids, $params);
|
|
|
|
|
$loginUserCountList = $promoteRepository->getLoginUserCountByIds($ids, $params);
|
|
|
|
|
|
|
|
|
|
$rechargeCountList = [];
|
|
|
|
|
$rechargeUserCountList = [];
|
|
|
|
|
$rechargeAmountList = [];
|
|
|
|
|
if ($this->canViewUserRecharge) {
|
|
|
|
|
$rechargeCountList = $promoteRepository->getRechargeCountByIds($ids, $params);
|
|
|
|
|
$rechargeUserCountList = $promoteRepository->getRechargeUserCountByIds($ids, $params);
|
|
|
|
|
$rechargeAmountList = $promoteRepository->getRechargeAmountByIds($ids, $params);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$records = [];
|
|
|
|
|
if (I('p', 1) == 1) {
|
|
|
|
|
$selfParams = $params;
|
|
|
|
@ -3080,12 +3116,8 @@ class DownloadController extends BaseController {
|
|
|
|
|
$selfNewCreateRoleUserCountList = $promoteRepository->getNewCreateRoleUserCountByIds([$parent['id']], $selfParams);
|
|
|
|
|
// $selfNewCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds([$parent['id']], $selfParams);
|
|
|
|
|
$selfNewCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds([$parent['id']], $selfParams);
|
|
|
|
|
|
|
|
|
|
$selfLoginUserCountList = $promoteRepository->getLoginUserCountByIds([$parent['id']], $selfParams);
|
|
|
|
|
$selfRechargeCountList = $promoteRepository->getRechargeCountByIds([$parent['id']], $selfParams);
|
|
|
|
|
$selfRechargeUserCountList = $promoteRepository->getRechargeUserCountByIds([$parent['id']], $selfParams);
|
|
|
|
|
$selfRechargeAmountList = $promoteRepository->getRechargeAmountByIds([$parent['id']], $selfParams);
|
|
|
|
|
$records[] = [
|
|
|
|
|
$record = [
|
|
|
|
|
'id' => $parent['id'],
|
|
|
|
|
'account' => $parent['account'],
|
|
|
|
|
'real_name' => mb_strlen($parent['real_name'],'utf-8') == 2 ? mb_substr($parent['real_name'],0,1,'utf-8').'*':mb_substr($parent['real_name'],0,1,'utf-8').'**',
|
|
|
|
@ -3096,18 +3128,24 @@ class DownloadController extends BaseController {
|
|
|
|
|
// 'new_create_role_device_count' => $selfNewCreateRoleDeviceCountList[$parent['id']],
|
|
|
|
|
'new_create_role_ip_count' => $selfNewCreateRoleIpCountList[$parent['id']],
|
|
|
|
|
'login_user_count' => $selfLoginUserCountList[$parent['id']],
|
|
|
|
|
'recharge_count' => $selfRechargeCountList[$parent['id']],
|
|
|
|
|
'recharge_user_count' => $selfRechargeUserCountList[$parent['id']],
|
|
|
|
|
'recharge_amount' => $selfRechargeAmountList[$parent['id']]['ban_coin'] + $selfRechargeAmountList[$parent['id']]['coin'] + $selfRechargeAmountList[$parent['id']]['cash'],
|
|
|
|
|
'recharge_by_ban_coin' => $selfRechargeAmountList[$parent['id']]['ban_coin'],
|
|
|
|
|
'recharge_by_coin' => $selfRechargeAmountList[$parent['id']]['coin'],
|
|
|
|
|
'recharge_by_cash' => $selfRechargeAmountList[$parent['id']]['cash'],
|
|
|
|
|
'current_display' => $currentDisplay,
|
|
|
|
|
];
|
|
|
|
|
if ($this->canViewUserRecharge) {
|
|
|
|
|
$selfRechargeCountList = $promoteRepository->getRechargeCountByIds([$parent['id']], $selfParams);
|
|
|
|
|
$selfRechargeUserCountList = $promoteRepository->getRechargeUserCountByIds([$parent['id']], $selfParams);
|
|
|
|
|
$selfRechargeAmountList = $promoteRepository->getRechargeAmountByIds([$parent['id']], $selfParams);
|
|
|
|
|
$record['recharge_count'] = $selfRechargeCountList[$parent['id']];
|
|
|
|
|
$record['recharge_user_count'] = $selfRechargeUserCountList[$parent['id']];
|
|
|
|
|
$record['recharge_amount'] = $selfRechargeAmountList[$parent['id']]['ban_coin'] + $selfRechargeAmountList[$parent['id']]['coin'] + $selfRechargeAmountList[$parent['id']]['cash'];
|
|
|
|
|
$record['recharge_by_ban_coin'] = $selfRechargeAmountList[$parent['id']]['ban_coin'];
|
|
|
|
|
$record['recharge_by_coin'] = $selfRechargeAmountList[$parent['id']]['coin'];
|
|
|
|
|
$record['recharge_by_cash'] = $selfRechargeAmountList[$parent['id']]['cash'];
|
|
|
|
|
}
|
|
|
|
|
$records[] = $record;
|
|
|
|
|
}
|
|
|
|
|
foreach ($promotes as $promote) {
|
|
|
|
|
$id = $promote['id'];
|
|
|
|
|
$records[] = [
|
|
|
|
|
$record = [
|
|
|
|
|
'id' => $id,
|
|
|
|
|
'account' => $promote['account'],
|
|
|
|
|
'real_name' => mb_strlen($promote['real_name'],'utf-8') == 2 ? mb_substr($promote['real_name'],0,1,'utf-8').'*':mb_substr($promote['real_name'],0,1,'utf-8').'**',
|
|
|
|
@ -3118,14 +3156,17 @@ class DownloadController extends BaseController {
|
|
|
|
|
'new_create_role_device_count' => $newCreateRoleDeviceCountList[$id],
|
|
|
|
|
'new_create_role_ip_count' => $newCreateRoleIpCountList[$id],
|
|
|
|
|
'login_user_count' => $loginUserCountList[$id],
|
|
|
|
|
'recharge_count' => $rechargeCountList[$id],
|
|
|
|
|
'recharge_user_count' => $rechargeUserCountList[$id],
|
|
|
|
|
'recharge_amount' => $rechargeAmountList[$id]['ban_coin'] + $rechargeAmountList[$id]['coin'] + $rechargeAmountList[$id]['cash'],
|
|
|
|
|
'recharge_by_ban_coin' => $rechargeAmountList[$id]['ban_coin'],
|
|
|
|
|
'recharge_by_coin' => $rechargeAmountList[$id]['coin'],
|
|
|
|
|
'recharge_by_cash' => $rechargeAmountList[$id]['cash'],
|
|
|
|
|
'current_display' => '',
|
|
|
|
|
];
|
|
|
|
|
if ($this->canViewUserRecharge) {
|
|
|
|
|
$record['recharge_count'] = $rechargeCountList[$id];
|
|
|
|
|
$record['recharge_user_count'] = $rechargeUserCountList[$id];
|
|
|
|
|
$record['recharge_amount'] = $rechargeAmountList[$id]['ban_coin'] + $rechargeAmountList[$id]['coin'] + $rechargeAmountList[$id]['cash'];
|
|
|
|
|
$record['recharge_by_ban_coin'] = $rechargeAmountList[$id]['ban_coin'];
|
|
|
|
|
$record['recharge_by_coin'] = $rechargeAmountList[$id]['coin'];
|
|
|
|
|
$record['recharge_by_cash'] = $rechargeAmountList[$id]['cash'];
|
|
|
|
|
}
|
|
|
|
|
$records[] = $record;
|
|
|
|
|
}
|
|
|
|
|
$xlsData = [];
|
|
|
|
|
foreach ($records as $key1 => $value1) {
|
|
|
|
|