推广平台>数据管理>每日概况|数据汇总--更新

master
chenxiaojun 5 years ago
parent 569fc37e40
commit 4f63f45374

@ -1128,15 +1128,17 @@ class QueryController extends BaseController
$newDeviceNumList = $userRepository->getNewCreateRoleDeviceCountByDay($params);//新创角设备
$newIpNumList = $userRepository->getNewCreateRoleIpCountByDay($params);//新创角IP
$loginUserNumList = $userRepository->getLoginCountGroupByDayNew($params);//登录用户数
$spendUserNumList = $spendRepository->getPayUserCountGroupByDayNew($params);//充值人数
$spendNumList = $spendRepository->getPayCountGroupByDay($params);//充值次数
$spendAllAmountList = $spendRepository->getPayAmountGroupByDayAndType($params);//充值总额
$params['pay_way'] = ['in', '1,2,3,4,5,6'];
$spendCashList = $spendRepository->getPayAmountGroupByDayAndType($params);//现金充值
$params['pay_way'] = 0;
$spendGenericList = $spendRepository->getPayAmountGroupByDayAndType($params);//通用币充值
$params['pay_way'] = -1;
$spendBindingList = $spendRepository->getPayAmountGroupByDayAndType($params);//绑定币充值
if ($this->canViewUserRecharge) {
$spendUserNumList = $spendRepository->getPayUserCountGroupByDayNew($params);//充值人数
$spendNumList = $spendRepository->getPayCountGroupByDay($params);//充值次数
$spendAllAmountList = $spendRepository->getPayAmountGroupByDayAndType($params);//充值总额
$params['pay_way'] = ['in', '1,2,3,4,5,6'];
$spendCashList = $spendRepository->getPayAmountGroupByDayAndType($params);//现金充值
$params['pay_way'] = 0;
$spendGenericList = $spendRepository->getPayAmountGroupByDayAndType($params);//通用币充值
$params['pay_way'] = -1;
$spendBindingList = $spendRepository->getPayAmountGroupByDayAndType($params);//绑定币充值
}
$allData['role_num'] = 0;
$allData['user_num'] = 0;
@ -1144,17 +1146,19 @@ class QueryController extends BaseController
$allData['new_device_num'] = 0;
$allData['new_ip_num'] = 0;
$allData['login_user_num'] = 0;
$allData['spend_user_num'] = 0;
$allData['spend_num'] = 0;
$allData['spend_all_amount'] = 0;
$allData['spend_cash'] = 0;
$allData['spend_generic'] = 0;
$allData['spend_binding'] = 0;
$allData['spend_discount'] = 0;
$allData['spend_voucher'] = 0;
if ($this->canViewUserRecharge) {
$allData['spend_user_num'] = 0;
$allData['spend_num'] = 0;
$allData['spend_all_amount'] = 0;
$allData['spend_cash'] = 0;
$allData['spend_generic'] = 0;
$allData['spend_binding'] = 0;
$allData['spend_discount'] = 0;
$allData['spend_voucher'] = 0;
}
foreach ($dayList as $day) {
$date = date('Ymd', strtotime($day));
$records[] = [
$record = [
'day' => $date,
'role_num' => $roleNumList[$day],
'user_num' => $userNumList[$day],
@ -1162,14 +1166,6 @@ class QueryController extends BaseController
'new_device_num' => $newDeviceNumList[$day],
'new_ip_num' => $newIpNumList[$day],
'login_user_num' => $loginUserNumList[$day],
'spend_user_num' => $spendUserNumList[$day],
'spend_num' => $spendNumList[$day],
'spend_all_amount' => $spendAllAmountList[$day],
'spend_cash' => $spendCashList[$day],
'spend_generic' => $spendGenericList[$day],
'spend_binding' => $spendBindingList[$day],
'spend_discount' => 0,
'spend_voucher' => 0,
];
$allData['role_num'] += $roleNumList[$day];
@ -1178,14 +1174,27 @@ class QueryController extends BaseController
$allData['new_device_num'] += $newDeviceNumList[$day];
$allData['new_ip_num'] += $newIpNumList[$day];
$allData['login_user_num'] += $loginUserNumList[$day];
$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);
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);
$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;
}
foreach ($dayListReverse as $day) {
$date = date('Ymd', strtotime($day));
@ -1194,8 +1203,10 @@ class QueryController extends BaseController
$summaryData['user_num'][] = $userNumList[$day];
$summaryData['new_user_num'][] = $newUserNumList[$day];
$summaryData['new_device_num'][] = $newDeviceNumList[$day];
$summaryData['spend_user_num'][] = $spendUserNumList[$day];
$summaryData['spend_all_amount'][] = $spendAllAmountList[$day];
if ($this->canViewUserRecharge) {
$summaryData['spend_user_num'][] = $spendUserNumList[$day];
$summaryData['spend_all_amount'][] = $spendAllAmountList[$day];
}
}
}
@ -1314,18 +1325,20 @@ class QueryController extends BaseController
$newDeviceNumList = $userRepository->getNewCreateRoleDeviceCountByGame($params);//新创角设备
$newIpNumList = $userRepository->getNewCreateRoleIpCountByGame($params);//新创角IP
$loginUserNumList = $userRepository->getLoginCountGroupByGame($params);//登录用户数
$spendUserNumList = $spendRepository->getPayUserCountGroupByGame($params);//充值人数
$spendNumList = $spendRepository->getPayCountGroupByGame($params);//充值次数
$spendAllAmountList = $spendRepository->getPayAmountGroupByGameAndType($params);//充值总额
$params['pay_way'] = ['in', '1,2,3,4,5,6'];
$spendCashList = $spendRepository->getPayAmountGroupByGameAndType($params);//现金充值
$params['pay_way'] = 0;
$spendGenericList = $spendRepository->getPayAmountGroupByGameAndType($params);//通用币充值
$params['pay_way'] = -1;
$spendBindingList = $spendRepository->getPayAmountGroupByGameAndType($params);//绑定币充值
if ($this->canViewUserRecharge) {
$spendUserNumList = $spendRepository->getPayUserCountGroupByGame($params);//充值人数
$spendNumList = $spendRepository->getPayCountGroupByGame($params);//充值次数
$spendAllAmountList = $spendRepository->getPayAmountGroupByGameAndType($params);//充值总额
$params['pay_way'] = ['in', '1,2,3,4,5,6'];
$spendCashList = $spendRepository->getPayAmountGroupByGameAndType($params);//现金充值
$params['pay_way'] = 0;
$spendGenericList = $spendRepository->getPayAmountGroupByGameAndType($params);//通用币充值
$params['pay_way'] = -1;
$spendBindingList = $spendRepository->getPayAmountGroupByGameAndType($params);//绑定币充值
}
foreach ($data as &$list) {
$gameId = $list['game_id'];
$records[] = [
$record = [
'game_id' => $gameId,
'game_name' => $list['game_name'],
'sdk_version' => $list['sdk_version'],
@ -1335,15 +1348,19 @@ class QueryController extends BaseController
'new_device_num' => $newDeviceNumList[$gameId],
'new_ip_num' => $newIpNumList[$gameId],
'login_user_num' => $loginUserNumList[$gameId],
'spend_user_num' => $spendUserNumList[$gameId],
'spend_num' => $spendNumList[$gameId],
'spend_all_amount' => $spendAllAmountList[$gameId],
'spend_cash' => $spendCashList[$gameId],
'spend_generic' => $spendGenericList[$gameId],
'spend_binding' => $spendBindingList[$gameId],
'spend_discount' => 0,
'spend_voucher' => 0,
];
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;
}
$records[] = $record;
}
$params['all_data'] = 1;
$params['game_ids'] = $allGameIs;
@ -1353,18 +1370,20 @@ class QueryController extends BaseController
$allData['new_device_num'] = $userRepository->getNewCreateRoleDeviceCountByGame($params);//新创角设备
$allData['new_ip_num'] = $userRepository->getNewCreateRoleIpCountByGame($params);//新创角IP
$allData['login_user_num'] = $userRepository->getLoginCountGroupByGame($params);//登录用户数
$allData['spend_user_num'] = $spendRepository->getPayUserCountByGame($params);//充值人数
$allData['spend_num'] = $spendRepository->getPayCountByGame($params);//充值次数
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';
if ($this->canViewUserRecharge) {
$allData['spend_user_num'] = $spendRepository->getPayUserCountByGame($params);//充值人数
$allData['spend_num'] = $spendRepository->getPayCountByGame($params);//充值次数
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';
}
}
}

@ -158,9 +158,11 @@
<p>新创角用户|设备</p>
</div>
<?php if ($canViewUserRecharge) :?>
<div class="btn btn-role btn-role-border" data-type="3">
<p>充值人数|充值总额</p>
</div>
<?php endif ;?>
</div>
</div>
</div>
@ -179,6 +181,7 @@
</th>
<th class="pointer-hand" title="新增创角IP统计时间范围内首次创建角色IP总数去重">新增创角IP</th>
<th class="pointer-hand" title="登录用户数:统计时间范围内,登录的用户数(去重)">登录用户数</th>
<?php if ($canViewUserRecharge) :?>
<th class="pointer-hand" title="充值人数当日24小时在游戏内充值成功的订单的用户数去重">充值人数</th>
<th class="pointer-hand" title="充值次数当日24小时在游戏内充值成功的订单数量">充值次数</th>
<th class="pointer-hand spend-btn" title="充值总额当日24小时在游戏内充值成功的订单金额总和" style="width: 200px;">充值总额<i
@ -192,6 +195,7 @@
<th class="pointer-hand spend-element th-hide" title="代金券使用:统计时间范围内,在游戏内充值成功的订单,使用代金券总和,该部分不参与结算">
代金劵使用
</th>
<?php endif ;?>
</tr>
<empty name="listData">
<tr class="num2">
@ -208,6 +212,7 @@
<td>{$allData.new_user_num}|{$allData.new_device_num}</td>
<td>{$allData.new_ip_num}</td>
<td>{$allData.login_user_num}</td>
<?php if ($canViewUserRecharge) :?>
<td>{$allData.spend_user_num}</td>
<td>{$allData.spend_num}</td>
<td>{$allData.spend_all_amount}</td>
@ -216,6 +221,7 @@
<td class="spend-element th-hide">{$allData.spend_binding}</td>
<td class="spend-element th-hide">{$allData.spend_discount}</td>
<td class="spend-element th-hide">{$allData.spend_voucher}</td>
<?php endif ;?>
</tr>
<volist name="listData" id="vo">
<tr class="num2">
@ -225,6 +231,7 @@
<td>{$vo.new_user_num}|{$vo.new_device_num}</td>
<td>{$vo.new_ip_num}</td>
<td>{$vo.login_user_num}</td>
<?php if ($canViewUserRecharge) :?>
<td>{$vo.spend_user_num}</td>
<td>{$vo.spend_num}</td>
<td>{$vo.spend_all_amount}</td>
@ -233,6 +240,7 @@
<td class="spend-element th-hide">{$vo.spend_binding}</td>
<td class="spend-element th-hide">{$vo.spend_discount}</td>
<td class="spend-element th-hide">{$vo.spend_voucher}</td>
<?php endif ;?>
</tr>
</volist>
</empty>
@ -323,10 +331,12 @@
dataName2 = '新创角设备';
break;
case 3:
<?php if ($canViewUserRecharge) :?>
data1 = spendUserNum;
data2 = spendAllAmount;
dataName1 = '充值人数';
dataName2 = '充值总额';
<?php endif ;?>
break;
}

@ -146,6 +146,7 @@
</th>
<th class="pointer-hand" title="新增创角IP统计时间范围内首次创建角色IP总数去重">新增创角IP</th>
<th class="pointer-hand" title="登录用户数:统计时间范围内,登录的用户数(去重)">登录用户数</th>
<?php if ($canViewUserRecharge) :?>
<th class="pointer-hand" title="充值人数当日24小时在游戏内充值成功的订单的用户数去重">充值人数</th>
<th class="pointer-hand" title="充值次数当日24小时在游戏内充值成功的订单数量">充值次数</th>
<th class="pointer-hand spend-btn" title="充值总额当日24小时在游戏内充值成功的订单金额总和" style="width: 200px;">充值总额<i
@ -159,6 +160,7 @@
<th class="pointer-hand spend-element th-hide" title="代金券使用:统计时间范围内,在游戏内充值成功的订单,使用代金券总和,该部分不参与结算">
代金劵使用
</th>
<?php endif ;?>
</tr>
<empty name="listData">
<tr class="num2">
@ -177,6 +179,7 @@
<td>{$vo.new_user_num}|{$vo.new_device_num}</td>
<td>{$vo.new_ip_num}</td>
<td>{$vo.login_user_num}</td>
<?php if ($canViewUserRecharge) :?>
<td>{$vo.spend_user_num}</td>
<td>{$vo.spend_num}</td>
<td>{$vo.spend_all_amount|default=0}</td>
@ -185,6 +188,7 @@
<td class="spend-element th-hide">{$vo.spend_binding|default=0}</td>
<td class="spend-element th-hide">{$vo.spend_discount|default=0}</td>
<td class="spend-element th-hide">{$vo.spend_voucher|default=0}</td>
<?php endif ;?>
</tr>
</volist>
<tr class="num2">
@ -195,6 +199,7 @@
<td>{$allData.new_user_num}|{$allData.new_device_num}</td>
<td>{$allData.new_ip_num}</td>
<td>{$allData.login_user_num}</td>
<?php if ($canViewUserRecharge) :?>
<td>{$allData.spend_user_num}</td>
<td>{$allData.spend_num}</td>
<td>{$allData.spend_all_amount}</td>
@ -203,6 +208,7 @@
<td class="spend-element th-hide">{$allData.spend_binding}</td>
<td class="spend-element th-hide">{$allData.spend_discount}</td>
<td class="spend-element th-hide">{$allData.spend_voucher}</td>
<?php endif ;?>
</tr>
</empty>
</table>

Loading…
Cancel
Save