master
ELF 5 years ago
parent 0cbc9e5d8a
commit 3092dcb237

@ -26,7 +26,9 @@ class PromoteRepository {
if (isset($params['isContainSubs']) && $params['isContainSubs']) { if (isset($params['isContainSubs']) && $params['isContainSubs']) {
$isContainSubs = true; $isContainSubs = true;
} }
foreach ($ids as $key => $id) {
$ids[$key] = intval($id);
}
$map = []; $map = [];
$map['promote_id'] = ['in', $ids]; $map['promote_id'] = ['in', $ids];
$allIds = $ids; $allIds = $ids;
@ -260,7 +262,22 @@ class PromoteRepository {
} }
$params['time_column'] = 'login_time'; $params['time_column'] = 'login_time';
$map = $this->getPublicAchievementMap($ids, $params); $map = $this->getPublicAchievementMap($ids, $params);
$items = M('user_login_record', 'tab_')->field(['count(DISTINCT user_id) as count', 'promote_id'])->where($map)->group('promote_id')->select();
$promoteIds = $map['promote_id'][1];
$tempRows = [];
$tempCount = 0;
$items = [];
foreach ($promoteIds as $promoteId) {
$tempCount ++;
$tempRows[] = $promoteId;
if ($tempCount == 20) {
$map['promote_id'] = ['in', $tempRows];
$rows = M('user_login_record', 'tab_')->field(['count(DISTINCT user_id) as count', 'promote_id'])->where($map)->group('promote_id')->select();
$tempRows = [];
$tempCount = 0;
$items = array_merge($items, $rows);
}
}
$records = []; $records = [];
foreach ($items as $item) { foreach ($items as $item) {

@ -2043,12 +2043,11 @@ class QueryController extends BaseController
list($beginTime, $endTime) = $this->getBetweenTime($time); list($beginTime, $endTime) = $this->getBetweenTime($time);
$params['begin_time'] = $beginTime; $params['begin_time'] = $beginTime;
$params['end_time'] = $endTime; $params['end_time'] = $endTime;
$promoteRepository = new PromoteRepository(); $promoteRepository = new PromoteRepository();
$createRoleCountList = $promoteRepository->getCreateRoleCountByIds($ids, $params); $createRoleCountList = $promoteRepository->getCreateRoleCountByIds($ids, $params);
$createRoleUserCountList = $promoteRepository->getCreateRoleUserCountByIds($ids, $params); $createRoleUserCountList = $promoteRepository->getCreateRoleUserCountByIds($ids, $params);
$newCreateRoleUserCountList = $promoteRepository->getNewCreateRoleUserCountByIds($ids, $params); $newCreateRoleUserCountList = $promoteRepository->getNewCreateRoleUserCountByIds($ids, $params);
$newCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds($ids, $params); // $newCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds($ids, $params);
$newCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds($ids, $params); $newCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds($ids, $params);
$loginUserCountList = $promoteRepository->getLoginUserCountByIds($ids, $params); $loginUserCountList = $promoteRepository->getLoginUserCountByIds($ids, $params);
$rechargeCountList = $promoteRepository->getRechargeCountByIds($ids, $params); $rechargeCountList = $promoteRepository->getRechargeCountByIds($ids, $params);
@ -2062,7 +2061,7 @@ class QueryController extends BaseController
$selfCreateRoleCountList = $promoteRepository->getCreateRoleCountByIds([$promote['id']], $selfParams); $selfCreateRoleCountList = $promoteRepository->getCreateRoleCountByIds([$promote['id']], $selfParams);
$selfCreateRoleUserCountList = $promoteRepository->getCreateRoleUserCountByIds([$promote['id']], $selfParams); $selfCreateRoleUserCountList = $promoteRepository->getCreateRoleUserCountByIds([$promote['id']], $selfParams);
$selfNewCreateRoleUserCountList = $promoteRepository->getNewCreateRoleUserCountByIds([$promote['id']], $selfParams); $selfNewCreateRoleUserCountList = $promoteRepository->getNewCreateRoleUserCountByIds([$promote['id']], $selfParams);
$selfNewCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds([$promote['id']], $selfParams); // $selfNewCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds([$promote['id']], $selfParams);
$selfNewCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds([$promote['id']], $selfParams); $selfNewCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds([$promote['id']], $selfParams);
$selfLoginUserCountList = $promoteRepository->getLoginUserCountByIds([$promote['id']], $selfParams); $selfLoginUserCountList = $promoteRepository->getLoginUserCountByIds([$promote['id']], $selfParams);
$selfRechargeCountList = $promoteRepository->getRechargeCountByIds([$promote['id']], $selfParams); $selfRechargeCountList = $promoteRepository->getRechargeCountByIds([$promote['id']], $selfParams);
@ -2077,7 +2076,7 @@ class QueryController extends BaseController
'create_role_count' => $selfCreateRoleCountList[$promote['id']], 'create_role_count' => $selfCreateRoleCountList[$promote['id']],
'create_role_user_count' => $selfCreateRoleUserCountList[$promote['id']], 'create_role_user_count' => $selfCreateRoleUserCountList[$promote['id']],
'new_create_role_user_count' => $selfNewCreateRoleUserCountList[$promote['id']], 'new_create_role_user_count' => $selfNewCreateRoleUserCountList[$promote['id']],
'new_create_role_device_count' => $selfNewCreateRoleDeviceCountList[$promote['id']], // 'new_create_role_device_count' => $selfNewCreateRoleDeviceCountList[$promote['id']],
'new_create_role_ip_count' => $selfNewCreateRoleIpCountList[$promote['id']], 'new_create_role_ip_count' => $selfNewCreateRoleIpCountList[$promote['id']],
'login_user_count' => $selfLoginUserCountList[$promote['id']], 'login_user_count' => $selfLoginUserCountList[$promote['id']],
'recharge_count' => $selfRechargeCountList[$promote['id']], 'recharge_count' => $selfRechargeCountList[$promote['id']],
@ -2099,7 +2098,7 @@ class QueryController extends BaseController
'create_role_count' => $createRoleCountList[$id], 'create_role_count' => $createRoleCountList[$id],
'create_role_user_count' => $createRoleUserCountList[$id], 'create_role_user_count' => $createRoleUserCountList[$id],
'new_create_role_user_count' => $newCreateRoleUserCountList[$id], 'new_create_role_user_count' => $newCreateRoleUserCountList[$id],
'new_create_role_device_count' => $newCreateRoleDeviceCountList[$id], // 'new_create_role_device_count' => $newCreateRoleDeviceCountList[$id],
'new_create_role_ip_count' => $newCreateRoleIpCountList[$id], 'new_create_role_ip_count' => $newCreateRoleIpCountList[$id],
'login_user_count' => $loginUserCountList[$id], 'login_user_count' => $loginUserCountList[$id],
'recharge_count' => $rechargeCountList[$id], 'recharge_count' => $rechargeCountList[$id],

@ -80,7 +80,7 @@
<th>创角数</th> <th>创角数</th>
<th>创角用户</th> <th>创角用户</th>
<th>新创角用户</th> <th>新创角用户</th>
<th>新创角设备</th> <!-- <th>新创角设备</th> -->
<th>新创角IP</th> <th>新创角IP</th>
<th>登录用户数</th> <th>登录用户数</th>
<th>充值人数</th> <th>充值人数</th>
@ -106,7 +106,7 @@
<td>{$record.create_role_count}</td> <td>{$record.create_role_count}</td>
<td>{$record.create_role_user_count}</td> <td>{$record.create_role_user_count}</td>
<td>{$record.new_create_role_user_count}</td> <td>{$record.new_create_role_user_count}</td>
<td>{$record.new_create_role_device_count}</td> <!-- <td>{$record.new_create_role_device_count}</td> -->
<td>{$record.new_create_role_ip_count}</td> <td>{$record.new_create_role_ip_count}</td>
<td>{$record.login_user_count}</td> <td>{$record.login_user_count}</td>
<td>{$record.recharge_count}</td> <td>{$record.recharge_count}</td>

Loading…
Cancel
Save