修改bug

master
ELF 5 years ago
parent 1c2458841d
commit 112d7462bc

@ -106,7 +106,6 @@ class PromoteRepository {
$params['time_column'] = 'create_time'; $params['time_column'] = 'create_time';
$map = $this->getPublicAchievementMap($ids, $params); $map = $this->getPublicAchievementMap($ids, $params);
$items = M('user_play_info', 'tab_')->field(['count(distinct user_id) count', 'promote_id'])->where($map)->group('promote_id')->select(); $items = M('user_play_info', 'tab_')->field(['count(distinct user_id) count', 'promote_id'])->where($map)->group('promote_id')->select();
$records = []; $records = [];
foreach ($items as $item) { foreach ($items as $item) {
$promoteId = $item['promote_id']; $promoteId = $item['promote_id'];
@ -119,7 +118,6 @@ class PromoteRepository {
$records[$promoteId] = $item['count']; $records[$promoteId] = $item['count'];
} }
} }
$records = $this->assembleZero($ids, $records, 0); $records = $this->assembleZero($ids, $records, 0);
return $records; return $records;
@ -188,7 +186,7 @@ class PromoteRepository {
$inQuery = M('user_play_info', 'tab_')->field('create_ip')->group('create_ip')->where($map)->buildSql(); $inQuery = M('user_play_info', 'tab_')->field('create_ip')->group('create_ip')->where($map)->buildSql();
$resultMap = ['create_ip' => ['exp', ' in (' . $inQuery . ')']]; $resultMap = ['create_ip' => ['exp', ' in (' . $inQuery . ')']];
$items = M('user_play_info', 'tab_')->field(['count(*) count', 'promote_id'])->where($resultMap)->group('promote_id')->select(); $items = M('user_play_info', 'tab_')->field(['count(DISTINCT create_ip) count', 'promote_id'])->where($resultMap)->group('promote_id')->select();
$records = []; $records = [];
foreach ($items as $item) { foreach ($items as $item) {
@ -233,7 +231,8 @@ class PromoteRepository {
$inQuery = M('user_play_info', 'tab_')->field('user_id')->group('user_id')->where($map)->buildSql(); $inQuery = M('user_play_info', 'tab_')->field('user_id')->group('user_id')->where($map)->buildSql();
$resultMap = ['_string' => 'user_id in (' . $inQuery . ')']; $resultMap = ['_string' => 'user_id in (' . $inQuery . ')'];
$items = M('user_play_info', 'tab_')->field(['count(*) count', 'promote_id'])->where($resultMap)->group('promote_id')->select(); $items = M('user_play_info', 'tab_')->field(['count(DISTINCT user_id) count', 'promote_id'])->where($resultMap)->group('promote_id')->select();
// var_dump(M()->getLastSql());
$records = []; $records = [];
foreach ($items as $item) { foreach ($items as $item) {
$promoteId = $item['promote_id']; $promoteId = $item['promote_id'];

Loading…
Cancel
Save