diff --git a/Application/Base/Repository/PromoteRepository.class.php b/Application/Base/Repository/PromoteRepository.class.php index 176a1998c..73b628815 100644 --- a/Application/Base/Repository/PromoteRepository.class.php +++ b/Application/Base/Repository/PromoteRepository.class.php @@ -40,8 +40,8 @@ class PromoteRepository { if (isset($params['sdk_version'])) { $map['sdk_version'] = $params['sdk_version']; } - if (isset($params['begin_time']) && isset($params['begin_time'])) { - $map['create_time'] = ['between', [$params['begin_time'], $params['end_time']]]; + if (isset($params['begin_time']) && isset($params['begin_time']) && isset($params['time_column'])) { + $map[$params['time_column']] = ['between', [$params['begin_time'], $params['end_time']]]; } return $map; } @@ -54,6 +54,7 @@ class PromoteRepository { if (count($ids) == 0) { return []; } + $params['time_column'] = 'create_time'; $map = $this->getPublicAchievementMap($ids, $params); $items = M('user_play_info', 'tab_')->field(['count(*) count', 'promote_id'])->where($map)->group('promote_id')->select(); $records = []; @@ -82,6 +83,8 @@ class PromoteRepository { if (count($ids) == 0) { return []; } + + $params['time_column'] = 'create_time'; $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(); @@ -111,6 +114,8 @@ class PromoteRepository { if (count($ids) == 0) { return []; } + + $params['time_column'] = 'create_time'; $map = $this->getPublicAchievementMap($ids, $params); $subMap = $map; @@ -150,6 +155,8 @@ class PromoteRepository { if (count($ids) == 0) { return []; } + + $params['time_column'] = 'create_time'; $map = $this->getPublicAchievementMap($ids, $params); $subMap = $map; @@ -189,6 +196,8 @@ class PromoteRepository { if (count($ids) == 0) { return []; } + + $params['time_column'] = 'create_time'; $map = $this->getPublicAchievementMap($ids, $params); $subMap = $map; @@ -228,8 +237,9 @@ class PromoteRepository { if (count($ids) == 0) { return []; } + $params['time_column'] = 'login_time'; $map = $this->getPublicAchievementMap($ids, $params); - $items = M('user', 'tab_')->field(['count(*) count', 'promote_id'])->where($map)->group('promote_id')->select(); + $items = M('user_login_record', 'tab_')->field(['count(DISTINCT user_id) as count', 'promote_id'])->where($map)->group('promote_id')->select(); $records = []; foreach ($items as $item) { @@ -257,6 +267,8 @@ class PromoteRepository { if (count($ids) == 0) { return []; } + + $params['time_column'] = 'pay_time'; $map = $this->getPublicAchievementMap($ids, $params); $items = M('spend', 'tab_')->field(['count(*) count', 'promote_id'])->where($map)->group('promote_id')->select(); @@ -287,6 +299,8 @@ class PromoteRepository { if (count($ids) == 0) { return []; } + + $params['time_column'] = 'pay_time'; $map = $this->getPublicAchievementMap($ids, $params); $items = M('spend', 'tab_')->field(['count(distinct user_id) count', 'promote_id'])->where($map)->group('promote_id')->select(); @@ -316,6 +330,8 @@ class PromoteRepository { if (count($ids) == 0) { return []; } + + $params['time_column'] = 'pay_time'; $map = $this->getPublicAchievementMap($ids, $params); $items = M('spend', 'tab_')->field(['sum(pay_amount) amount', 'promote_id', 'pay_way'])->where($map)->group('promote_id, pay_way')->select(); $records = []; diff --git a/Application/Base/Service/GameSourceService.class.php b/Application/Base/Service/GameSourceService.class.php new file mode 100644 index 000000000..75511a60c --- /dev/null +++ b/Application/Base/Service/GameSourceService.class.php @@ -0,0 +1,45 @@ +getGameSourceUrl($gameSource)); + if ($zipGameSource) { + while ($zipEntry = zip_read($zipGameSource)) { + if (preg_match("/^Payload.*?\.app/", zip_entry_name($zipEntry), $matches)) { + $preUrl = $matches[0]; + break; + } + } + zip_close($zipGameSource); + } + $configUrl = $preUrl . '/_CodeSignature/TXChannel'; + } + return $configUrl; + } + + public function getGameSourceUrl($gameSource){ + $path = ''; + if($gameSource['file_type'] == '1'){ + $path = './Uploads/SourcePack/'; + }else{ + $path = './Uploads/Ios/original/'; + } + $fileUrl = $path . $gameSource['file_name']; + return ROOTTT . ltrim($fileUrl, './'); + } +} \ No newline at end of file diff --git a/Application/Common/Common/extend.php b/Application/Common/Common/extend.php index e3125c52f..b3c9cb626 100644 --- a/Application/Common/Common/extend.php +++ b/Application/Common/Common/extend.php @@ -2804,3 +2804,12 @@ function sendBrushMail($to,$content) { $mail->AltBody = $c; //邮件正文不支持HTML的备用显示 return($mail->Send()); } + +function index_by_column($column, $items) +{ + $records = []; + foreach ($items as $item) { + $records[$item[$column]] = $item; + } + return $records; +} diff --git a/Application/Home/Controller/BaseController.class.php b/Application/Home/Controller/BaseController.class.php index f19cc2181..385379e8c 100644 --- a/Application/Home/Controller/BaseController.class.php +++ b/Application/Home/Controller/BaseController.class.php @@ -172,7 +172,7 @@ class BaseController extends HomeController{ 'p' => $page, 'row' => $pageSize ]; - $pagination = set_pagination($count, $pageSize); + $pagination = set_pagination($count, $pageSize, $_POST); return [$records, $pagination, $count]; } diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 44c3e67c2..3541106b5 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -652,10 +652,10 @@ class QueryController extends BaseController { $this->meta_title = 'ARPU统计'; - $defaultTime = date('Y-m-d', time() - 7 * 24 * 3600) . ' 至 ' . date('Y-m-d'); - $defaultTime = date('Y-m-d', time() - 7 * 24 * 3600) . ' 至 ' . date('Y-m-d'); + $defaultTime = date('Y-m-d', time() - 6 * 24 * 3600) . ' 至 ' . date('Y-m-d'); - $time = I('time', $defaultTime); + $time = I('time', ''); + $time = $time == '' ? $defaultTime : $time; $sdkVersion = I('sdk_version', 0); $gameId = I('game_id', 0); $serverId = I('server_id', 0); @@ -672,11 +672,15 @@ class QueryController extends BaseController $games = $this->getGamesByPromote($promote); $params = []; + $searchGameName = ''; + $searchServerName = ''; if ($gameId > 0) { $params['game_id'] = $gameId; + $searchGameName = M('game', 'tab_')->where(['id' => $gameId])->getField('game_name'); } if ($serverId > 0) { $params['server_id'] = $serverId; + $searchServerName = M('server', 'tab_')->where(['server_id' => $serverId])->getField('server_name'); } if ($sdkVersion > 0) { $params['sdk_version'] = $sdkVersion; @@ -727,9 +731,19 @@ class QueryController extends BaseController $this->assign('subPromotes', $subPromotes); $this->assign('timeout', $timeout); $this->assign('records', $records); + $this->assign('searchGameName', $searchGameName); + $this->assign('searchServerName', $searchServerName); $this->display(); } + public function gameArpu() + { + $time = I('time'); + $data = M('Apply', 'tab_')->field('game_id, game_name')->where(['promote_id' => $promote_id])->order('game_id desc')->select(); + + + } + public function arpu_analysis() { $this->meta_title = "ARPU统计"; @@ -1730,6 +1744,13 @@ class QueryController extends BaseController 'parent_id' => $promote['id'], 'grand_id' => $promote['id'], ]; + if ($headmanPromoteId > 0) { + $map['parent_id'] = $headmanPromoteId; + } + if ($promoteId > 0) { + $map['id'] = $promoteId; + } + $ids = M('promote', 'tab_')->where($map)->getField('id', true); $promotes = []; @@ -1751,7 +1772,7 @@ class QueryController extends BaseController $map['role_name'] = ['like', '%' . $roleName . '%']; } if ($userAccount != '') { - $map['user_acount'] = ['like', '%' . $userAccount . '%']; + $map['user_account'] = ['like', '%' . $userAccount . '%']; } if ($sdkVersion != 0) { $map['sdk_version'] = $sdkVersion; @@ -1778,7 +1799,6 @@ class QueryController extends BaseController } if ($isSelf) { $map['promote_id'] = $promote['id']; - } else { if ($headmanPromoteId != 0) { $map['promote_id'] = $headmanPromoteId; } @@ -1818,6 +1838,12 @@ class QueryController extends BaseController 'parent_id' => $promote['id'], 'grand_id' => $promote['id'], ]; + if ($headmanPromoteId > 0) { + $map['parent_id'] = $headmanPromoteId; + } + if ($promoteId > 0) { + $map['id'] = $promoteId; + } $ids = M('promote', 'tab_')->where($map)->getField('id', true); $promotes = []; @@ -1837,7 +1863,7 @@ class QueryController extends BaseController $map['role_name'] = ['like', '%' . $roleName . '%']; } if ($userAccount != '') { - $map['user_acount'] = ['like', '%' . $userAccount . '%']; + $map['user_account'] = ['like', '%' . $userAccount . '%']; } if ($sdkVersion != 0) { $map['sdk_version'] = $sdkVersion; @@ -1845,11 +1871,12 @@ class QueryController extends BaseController if ($isSelf) { $map['promote_id'] = $promote['id']; $spendMap['promote_id'] = $promote['id']; - } else { + if ($headmanPromoteId != 0) { $map['promote_id'] = $headmanPromoteId; $spendMap['promote_id'] = $headmanPromoteId; } + if ($promoteId != 0) { $map['promote_id'] = $promoteId; $spendMap['promote_id'] = $promoteId; @@ -2009,6 +2036,7 @@ class QueryController extends BaseController $gameId = I('game_id', 0); $serverId = I('server_id', 0); $parentId = I('parent_id', 0); + $promoteId = I('promote_id', 0); $loginPromote = $this->getLoginPromote(); @@ -2023,7 +2051,12 @@ class QueryController extends BaseController $subPromotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $promote['id']])->select(); - $query = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $promote['id']]); + $map = ['parent_id' => $promote['id']]; + if ($promoteId > 0) { + $map['id'] = $promoteId; + } + + $query = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where($map); list($promotes, $pagination, $count) = $this->paginate($query); $ids = array_column($promotes, 'id'); diff --git a/Application/Home/View/default/Query/achievement.html b/Application/Home/View/default/Query/achievement.html index b58234f1d..7982e7b71 100644 --- a/Application/Home/View/default/Query/achievement.html +++ b/Application/Home/View/default/Query/achievement.html @@ -23,7 +23,8 @@