Merge branch 'hotfix/test_resource_new' of wmtx/platform into release

修改
master
廖金灵 4 years ago committed by Gogs
commit 7efbf84444

@ -1160,7 +1160,7 @@ class PromoteService {
$selfGameIds = $topGameIds; $selfGameIds = $topGameIds;
// $selfGameIds = $promote['game_ids'] == '' ? [] : explode(',', $promote['game_ids']); // $selfGameIds = $promote['game_ids'] == '' ? [] : explode(',', $promote['game_ids']);
// $selfGameIds = array_intersect($topGameIds, $selfGameIds); // $selfGameIds = array_intersect($topGameIds, $selfGameIds);
if ($promote['level'] == 1) { if ($promote['level'] == 1) {
return $selfGameIds; return $selfGameIds;
} }

@ -33,10 +33,17 @@ class TestingResourceController extends BaseController
'_string' => '1=1' '_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 仅有游戏猫 * @todo 仅有游戏猫
*/ */
$strCondition = 'game_id in (229, 230)'; $strCondition .= ' and game_id in (229, 230)';
if ($createTimeStart) { if ($createTimeStart) {
$strCondition .= ' and create_time >=' . strtotime($createTimeStart . ' 00:00:00'); $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); $subSql = M('testing_user', 'tab_')->field(['user_id'])->where($subConditions)->select(false);
$strCondition .= ' and user_id in (' . $subSql . ')'; $strCondition .= ' and user_id in (' . $subSql . ')';
$promoteService = new PromoteService();
$strCondition .= ' and promote_id in (' . $promoteService->subInSql($loginPromote) . ')'; $strCondition .= ' and promote_id in (' . $promoteService->subInSql($loginPromote) . ')';
if ($account) { if ($account) {
@ -708,6 +714,13 @@ class TestingResourceController extends BaseController
$map = [ $map = [
'id' => ['in', [229, 230]] '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(); return M('game', 'tab_')->field('id,game_name')->where($map)->select();
} }

Loading…
Cancel
Save