diff --git a/Application/Base/Repository/PromoteRepository.class.php b/Application/Base/Repository/PromoteRepository.class.php index b21ee2073..089dd3fab 100644 --- a/Application/Base/Repository/PromoteRepository.class.php +++ b/Application/Base/Repository/PromoteRepository.class.php @@ -26,7 +26,9 @@ class PromoteRepository { if (isset($params['isContainSubs']) && $params['isContainSubs']) { $isContainSubs = true; } - + foreach ($ids as $key => $id) { + $ids[$key] = intval($id); + } $map = []; $map['promote_id'] = ['in', $ids]; $allIds = $ids; @@ -260,7 +262,22 @@ class PromoteRepository { } $params['time_column'] = 'login_time'; $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 = []; foreach ($items as $item) { diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 78039b451..6ffcbd38b 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -2043,12 +2043,11 @@ class QueryController extends BaseController list($beginTime, $endTime) = $this->getBetweenTime($time); $params['begin_time'] = $beginTime; $params['end_time'] = $endTime; - $promoteRepository = new PromoteRepository(); $createRoleCountList = $promoteRepository->getCreateRoleCountByIds($ids, $params); $createRoleUserCountList = $promoteRepository->getCreateRoleUserCountByIds($ids, $params); $newCreateRoleUserCountList = $promoteRepository->getNewCreateRoleUserCountByIds($ids, $params); - $newCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds($ids, $params); + // $newCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds($ids, $params); $newCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds($ids, $params); $loginUserCountList = $promoteRepository->getLoginUserCountByIds($ids, $params); $rechargeCountList = $promoteRepository->getRechargeCountByIds($ids, $params); @@ -2062,7 +2061,7 @@ class QueryController extends BaseController $selfCreateRoleCountList = $promoteRepository->getCreateRoleCountByIds([$promote['id']], $selfParams); $selfCreateRoleUserCountList = $promoteRepository->getCreateRoleUserCountByIds([$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); $selfLoginUserCountList = $promoteRepository->getLoginUserCountByIds([$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_user_count' => $selfCreateRoleUserCountList[$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']], 'login_user_count' => $selfLoginUserCountList[$promote['id']], 'recharge_count' => $selfRechargeCountList[$promote['id']], @@ -2099,7 +2098,7 @@ class QueryController extends BaseController 'create_role_count' => $createRoleCountList[$id], 'create_role_user_count' => $createRoleUserCountList[$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], 'login_user_count' => $loginUserCountList[$id], 'recharge_count' => $rechargeCountList[$id], diff --git a/Application/Home/View/default/Query/achievement.html b/Application/Home/View/default/Query/achievement.html index b957d8359..3fc49608c 100644 --- a/Application/Home/View/default/Query/achievement.html +++ b/Application/Home/View/default/Query/achievement.html @@ -80,7 +80,7 @@