diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index 30e2bcf7d..41c4fd8f0 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -1160,7 +1160,7 @@ class PromoteService { $selfGameIds = $topGameIds; // $selfGameIds = $promote['game_ids'] == '' ? [] : explode(',', $promote['game_ids']); // $selfGameIds = array_intersect($topGameIds, $selfGameIds); - + if ($promote['level'] == 1) { return $selfGameIds; } diff --git a/Application/Home/Controller/TestingResourceController.class.php b/Application/Home/Controller/TestingResourceController.class.php index 5ad14b647..d7e64dbfc 100644 --- a/Application/Home/Controller/TestingResourceController.class.php +++ b/Application/Home/Controller/TestingResourceController.class.php @@ -33,10 +33,17 @@ class TestingResourceController extends BaseController '_string' => '1=1' ]; + $promoteService = new PromoteService(); + $visibleGameIds = $promoteService->getVisibleGameIds($loginPromote); + $strCondition = 'game_id in (0)'; + if (count($visibleGameIds) > 0) { + $strCondition = 'game_id in (' . implode(',', $visibleGameIds) . ')'; + } + /** * @todo 仅有游戏猫 */ - $strCondition = 'game_id in (229, 230)'; + $strCondition .= ' and game_id in (229, 230)'; if ($createTimeStart) { $strCondition .= ' and create_time >=' . strtotime($createTimeStart . ' 00:00:00'); @@ -48,7 +55,6 @@ class TestingResourceController extends BaseController $subSql = M('testing_user', 'tab_')->field(['user_id'])->where($subConditions)->select(false); $strCondition .= ' and user_id in (' . $subSql . ')'; - $promoteService = new PromoteService(); $strCondition .= ' and promote_id in (' . $promoteService->subInSql($loginPromote) . ')'; if ($account) { @@ -708,6 +714,13 @@ class TestingResourceController extends BaseController $map = [ 'id' => ['in', [229, 230]] ]; + $loginPromote = $this->getLoginPromote(); + $promoteService = new PromoteService(); + $visibleGameIds = $promoteService->getVisibleGameIds($loginPromote); + $map['_string'] = 'id in (0)'; + if (count($visibleGameIds) > 0) { + $map['_string'] = 'id in (' . implode(',', $visibleGameIds) . ')'; + } return M('game', 'tab_')->field('id,game_name')->where($map)->select(); }