|
|
|
@ -101,6 +101,10 @@ class HomeController extends Controller
|
|
|
|
|
|
|
|
|
|
public function promitionofregestion()
|
|
|
|
|
{
|
|
|
|
|
// 旧版兼容
|
|
|
|
|
A('Home')->landingPage();
|
|
|
|
|
die();
|
|
|
|
|
|
|
|
|
|
$gameData = M('Game', 'tab_')
|
|
|
|
|
->field('relation_game_id,sdk_version')
|
|
|
|
|
->where(array('id' => intval($_GET['gid'])))
|
|
|
|
@ -131,14 +135,27 @@ class HomeController extends Controller
|
|
|
|
|
public function landingPage()
|
|
|
|
|
{
|
|
|
|
|
$code = I('code', '');
|
|
|
|
|
if ($code == '') {
|
|
|
|
|
$this->redirect("download/downloadError", ['message' => '访问错误']);
|
|
|
|
|
$gameId = I('gid', 0);
|
|
|
|
|
$promoteId = I('pid', 0);
|
|
|
|
|
|
|
|
|
|
if ($code == '' && ($gameId == 0 || $promoteId == 0)) {
|
|
|
|
|
$this->error('访问错误');
|
|
|
|
|
}
|
|
|
|
|
$blackList = [];
|
|
|
|
|
if (in_array($code, $blackList) || in_array('gid/' . $gameId . '/pid/' . $promoteId, $blackList)) {
|
|
|
|
|
$this->error('该链接已被禁');
|
|
|
|
|
}
|
|
|
|
|
$applyService = new ApplyService();
|
|
|
|
|
$data = $applyService->decodeApplyCode($code);
|
|
|
|
|
$result = $applyService->checkApplyCode($data, ApplyService::ENCRYPT_TYPE_LANDING_PAGE);
|
|
|
|
|
if (!$result['status']) {
|
|
|
|
|
$this->error($result['message']);
|
|
|
|
|
|
|
|
|
|
if ($code != '') {
|
|
|
|
|
$applyService = new ApplyService();
|
|
|
|
|
$data = $applyService->decodeApplyCode($code);
|
|
|
|
|
$result = $applyService->checkApplyCode($data, ApplyService::ENCRYPT_TYPE_LANDING_PAGE);
|
|
|
|
|
if (!$result['status']) {
|
|
|
|
|
$this->error($result['message']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$gameId = $data['game_id'];
|
|
|
|
|
$promoteId = $data['promote_id'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$isWechat = Request::isWechat();
|
|
|
|
@ -157,7 +174,7 @@ class HomeController extends Controller
|
|
|
|
|
'features',
|
|
|
|
|
'flooring_page_imgs',
|
|
|
|
|
];
|
|
|
|
|
$map = ['id' => intval($data['game_id'])];
|
|
|
|
|
$map = ['id' => intval($gameId)];
|
|
|
|
|
|
|
|
|
|
$game = M('game', 'tab_')->field($columns)->where($map)->find();
|
|
|
|
|
|
|
|
|
@ -171,7 +188,7 @@ class HomeController extends Controller
|
|
|
|
|
$game = M('game', 'tab_')->field($columns)->where($map)->find();
|
|
|
|
|
}
|
|
|
|
|
$apply = M('apply', 'tab_')->field(['game_id', 'enable_status', 'promote_id'])
|
|
|
|
|
->where(['promote_id' => $data['promote_id'], 'game_id' => $game['id']])
|
|
|
|
|
->where(['promote_id' => $promoteId, 'game_id' => $game['id']])
|
|
|
|
|
->find();
|
|
|
|
|
$game['icon'] = get_cover($game['icon'], 'path');
|
|
|
|
|
|
|
|
|
|