充值信息根据会长权限显示导出部分

master
sunke 5 years ago
parent 4f63f45374
commit 4793665896

@ -2023,24 +2023,25 @@ class DownloadController extends BaseController {
public function summaryExcelInfo($id,$map) { public function summaryExcelInfo($id,$map) {
$xlsName = "数据汇总"; $xlsName = "数据汇总";
$xlsCell = array( $xlsCell = array(
array('game_name','游戏名称'), array('game_name','游戏名称'),
array('sdk_version','平台'), array('sdk_version','平台'),
array('role_num','创角数'), array('role_num','创角数'),
array('user_num','创建用户'), array('user_num','创建用户'),
array('new_user_num','新创角用户'), array('new_user_num','新创角用户'),
array('new_device_num','新创角设备'), array('new_device_num','新创角设备'),
array('new_ip_num','新增创角ip'), array('new_ip_num','新增创角ip'),
array('login_user_num','登陆用户数'), array('login_user_num','登陆用户数'),
array('spend_user_num','充值人数'), );
array('spend_num','充值次数'), if($this->canViewUserRecharge) {
array('spend_all_amount','充值总额'), $xlsCell[] = array('spend_user_num','充值人数');
array('spend_cash','现金充值'), $xlsCell[] = array('spend_num','充值次数');
array('spend_generic','通用币充值'), $xlsCell[] = array('spend_all_amount','充值总额');
array('spend_binding','绑定币充值'), $xlsCell[] = array('spend_cash','现金充值');
array('spend_discount','折扣币充值'), $xlsCell[] = array('spend_generic','通用币充值');
array('spend_voucher','代金券使用'), $xlsCell[] = array('spend_binding','绑定币充值');
$xlsCell[] = array('spend_discount','折扣币充值');
); $xlsCell[] = array('spend_voucher','代金券使用');
}
if(!empty($map['tab_apply.promote_id'][1])) { if(!empty($map['tab_apply.promote_id'][1])) {
$params['promote_ids'] = $map['tab_apply.promote_id'][1]; $params['promote_ids'] = $map['tab_apply.promote_id'][1];
} }
@ -2135,20 +2136,33 @@ class DownloadController extends BaseController {
$allData['new_user_num'] = $userRepository->getNewCreateRoleUserCountByGame($params);//新创角用户 $allData['new_user_num'] = $userRepository->getNewCreateRoleUserCountByGame($params);//新创角用户
$allData['new_device_num'] = $userRepository->getNewCreateRoleDeviceCountByGame($params);//新创角设备 $allData['new_device_num'] = $userRepository->getNewCreateRoleDeviceCountByGame($params);//新创角设备
$allData['new_ip_num'] = $userRepository->getNewCreateRoleIpCountByGame($params);//新创角IP $allData['new_ip_num'] = $userRepository->getNewCreateRoleIpCountByGame($params);//新创角IP
$allData['login_user_num'] = $userRepository->getLoginCountGroupByGame($params);//登录用户数 $allData['login_user_num'] = $userRepository->getLoginCountGroupByGame($params);//登录用户数
$allData['spend_user_num'] = $spendRepository->getPayUserCountByGame($params);//充值人数
$allData['spend_num'] = $spendRepository->getPayCountByGame($params);//充值次数 if($this->canViewUserRecharge) {
unset($params['pay_way']); $record['spend_user_num'] = $spendUserNumList[$gameId];
$allData['spend_all_amount'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//充值总额 $record['spend_num'] = $spendNumList[$gameId];
$params['pay_way'] = ['in', '1,2,3,4,5,6']; $record['spend_all_amount'] = $spendAllAmountList[$gameId];
$allData['spend_cash'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//现金充值 $record['spend_cash'] = $spendCashList[$gameId];
$params['pay_way'] = 0; $record['spend_generic'] = $spendGenericList[$gameId];
$allData['spend_generic'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//通用币充值 $record['spend_binding'] = $spendBindingList[$gameId];
$params['pay_way'] = -1; $record['spend_discount'] = 0;
$allData['spend_binding'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//绑定币充值 $record['spend_voucher'] = 0;
$allData['spend_discount'] = '0.00'; $allData['spend_user_num'] = $spendRepository->getPayUserCountByGame($params);//充值人数
$allData['spend_voucher'] = '0.00'; $allData['spend_num'] = $spendRepository->getPayCountByGame($params);//充值次数
$records[] = $allData; unset($params['pay_way']);
$allData['spend_all_amount'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//充值总额
$params['pay_way'] = ['in', '1,2,3,4,5,6'];
$allData['spend_cash'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//现金充值
$params['pay_way'] = 0;
$allData['spend_generic'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//通用币充值
$params['pay_way'] = -1;
$allData['spend_binding'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//绑定币充值
$allData['spend_discount'] = '0.00';
$allData['spend_voucher'] = '0.00';
}
$records[] = $record;
$records[] = $allData;
} }
} }
@ -2887,23 +2901,26 @@ class DownloadController extends BaseController {
public function dailysummaryExcelInfo($id,$map) { public function dailysummaryExcelInfo($id,$map) {
$xlsName = "每日概况"; $xlsName = "每日概况";
$xlsCell = array( $xlsCell = array(
array('day','日期'), array('day','日期'),
array('role_num','创角数'), array('role_num','创角数'),
array('user_num','创角用户'), array('user_num','创角用户'),
array('new_user_num','新创角用户'), array('new_user_num','新创角用户'),
array('new_device_num','新创角设备'), array('new_device_num','新创角设备'),
array('new_ip_num','新增创角IP'), array('new_ip_num','新增创角IP'),
array('login_user_num','登陆用户数'), array('login_user_num','登陆用户数'),
array('spend_user_num','充值人数'),
array('spend_num','充值次数'), );
array('spend_all_amount','充值总额'),
array('spend_cash','现金充值'), if ($this->canViewUserRecharge) {
array('spend_generic','通用币充值'), $xlsCell[] = array('spend_user_num','充值人数');
array('spend_binding','绑定币充值'), $xlsCell[] = array('spend_num','充值次数');
array('spend_discount','折扣币充值'), $xlsCell[] = array('spend_all_amount','充值总额');
array('spend_voucher','代金劵使用'), $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'); $nowTime = date('Y-m-d');
$initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime'); $initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime');
@ -2932,7 +2949,6 @@ class DownloadController extends BaseController {
} }
$params['dayList'] = $map["dayList"]; $params['dayList'] = $map["dayList"];
$summaryData = []; $summaryData = [];
$records = [];
if (intval($endTime - $begTime) / (24 * 3600) <= 30) { if (intval($endTime - $begTime) / (24 * 3600) <= 30) {
$userRepository = new UserRepository(); $userRepository = new UserRepository();
$spendRepository = new SpendRepository(); $spendRepository = new SpendRepository();
@ -2957,14 +2973,16 @@ class DownloadController extends BaseController {
$allData['new_device_num'] = 0; $allData['new_device_num'] = 0;
$allData['new_ip_num'] = 0; $allData['new_ip_num'] = 0;
$allData['login_user_num'] = 0; $allData['login_user_num'] = 0;
$allData['spend_user_num'] = 0; if($this->canViewUserRecharge) {
$allData['spend_num'] = 0; $allData['spend_user_num'] = 0;
$allData['spend_all_amount'] = 0; $allData['spend_num'] = 0;
$allData['spend_cash'] = 0; $allData['spend_all_amount'] = 0;
$allData['spend_generic'] = 0; $allData['spend_cash'] = 0;
$allData['spend_binding'] = 0; $allData['spend_generic'] = 0;
$allData['spend_discount'] = 0; $allData['spend_binding'] = 0;
$allData['spend_voucher'] = 0; $allData['spend_discount'] = 0;
$allData['spend_voucher'] = 0;
}
foreach ($params['dayList'] as $day) { foreach ($params['dayList'] as $day) {
$date = date('Ymd', strtotime($day)); $date = date('Ymd', strtotime($day));
$records[] = [ $records[] = [
@ -2990,15 +3008,26 @@ class DownloadController extends BaseController {
$allData['new_device_num'] += $newDeviceNumList[$day]; $allData['new_device_num'] += $newDeviceNumList[$day];
$allData['new_ip_num'] += $newIpNumList[$day]; $allData['new_ip_num'] += $newIpNumList[$day];
$allData['login_user_num'] += $loginUserNumList[$day]; $allData['login_user_num'] += $loginUserNumList[$day];
$allData['spend_user_num'] += $spendUserNumList[$day]; if ($this->canViewUserRecharge) {
$allData['spend_num'] += $spendNumList[$day]; $record['spend_user_num'] = $spendUserNumList[$day];
$allData['spend_all_amount'] = bcadd($allData['spend_all_amount'], $spendAllAmountList[$day], 2); $record['spend_num'] = $spendNumList[$day];
$allData['spend_cash'] = bcadd($allData['spend_cash'], $spendCashList[$day], 2); $record['spend_all_amount'] = $$spendAllAmountList[$day];
$allData['spend_generic'] = bcadd($allData['spend_generic'], $spendGenericList[$day], 2); $record['spend_cash'] = $spendCashList[$day];
$allData['spend_binding'] = bcadd($allData['spend_binding'], $spendBindingList[$day], 2); $record['spend_generic'] = $spendGenericList[$day];
$allData['spend_discount'] = bcadd($allData['spend_discount'], 0, 2); $record['spend_binding'] = $spendBindingList[$day];
$allData['spend_voucher'] = bcadd($allData['spend_voucher'], 0, 2); $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);
$allData['spend_cash'] = bcadd($allData['spend_cash'], $spendCashList[$day], 2);
$allData['spend_generic'] = bcadd($allData['spend_generic'], $spendGenericList[$day], 2);
$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'] = '合计'; $allData['day'] = '合计';
$records[] = $allData; $records[] = $allData;

Loading…
Cancel
Save