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/Conf/config.php b/Application/Home/Conf/config.php index 149f96326..36b9fe1af 100644 --- a/Application/Home/Conf/config.php +++ b/Application/Home/Conf/config.php @@ -64,6 +64,8 @@ return array( '__IMG__' => __ROOT__ . '/Public/' . MODULE_NAME . '/images', '__CSS__' => __ROOT__ . '/Public/' . MODULE_NAME . '/css', '__JS__' => __ROOT__ . '/Public/' . MODULE_NAME . '/js', + '__LAY__' => __ROOT__ . '/Public/' . MODULE_NAME . '/layui', + ), /* SESSION 和 COOKIE 配置 */ 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/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index 35d539ef7..789c7ea94 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -36,8 +36,8 @@ class PromoteController extends BaseController public function index($p = 1) { $this->meta_title = "首页"; -// $this->display('prepare'); -// exit(0); + $this->display('prepare'); + exit(0); header("Content-type:text/html;charset=utf-8"); $user = D('Promote')->isLogin(); diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 44c3e67c2..6ab6a23ff 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -84,11 +84,15 @@ class QueryController extends BaseController $map['tab_spend.pay_time'] = ['between', [strtotime(I('begtime')), strtotime(I('endtime')) + 86399]]; } - if (I('pay_way') !== null && I('pay_way') !== '') { - if (I('pay_way') == 2) { - $map['tab_spend.pay_way'] = ['in', '2,3,4']; - } else { - $map['tab_spend.pay_way'] = I('pay_way'); + if (isset($_REQUEST['pay_way']) && $_REQUEST['pay_way'] !== '') { + $payWay = intval(I('pay_way')); + + if (in_array($payWay, array_keys(QueryController::$payWay))) { + if ($payWay == 2) { + $map['tab_spend.pay_way'] = ['in', '2,3,4']; + } else { + $map['tab_spend.pay_way'] = $payWay; + } } } @@ -222,6 +226,7 @@ class QueryController extends BaseController } empty(I('account')) || $map['tab_user.account'] = ['like', '%' . I('account') . '%']; + empty(I('id')) || $map['tab_user.id'] = intval(I('id')); $data = M('User', 'tab_') ->field('tab_user.*,tab_promote.real_name as pro_real_name') @@ -652,10 +657,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); @@ -667,16 +672,20 @@ class QueryController extends BaseController 'grand_id' => $promote['id'], ]; $ids = M('promote', 'tab_')->where($map)->getField('id', true); - + $subPromotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $promote['id']])->select(); $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 +736,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 +1749,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 +1777,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 +1804,6 @@ class QueryController extends BaseController } if ($isSelf) { $map['promote_id'] = $promote['id']; - } else { if ($headmanPromoteId != 0) { $map['promote_id'] = $headmanPromoteId; } @@ -1818,6 +1843,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 +1868,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 +1876,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 +2041,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 +2056,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/Apply/feature.html b/Application/Home/View/default/Apply/feature.html index 5899f9518..a5815a975 100644 --- a/Application/Home/View/default/Apply/feature.html +++ b/Application/Home/View/default/Apply/feature.html @@ -6,7 +6,7 @@ - + - +
- - - + + +