修改落地页/下载页

master
ELF 5 years ago
parent d2b7e91a64
commit 79f9801351

@ -197,4 +197,16 @@ class ApplyService {
parse_str($items['query'], $params);
return $params;
}
public function checkSociatyPerm($promote, $game)
{
$promoteService = new PromoteService();
$topPromote = $promoteService->getTopPromote($promote);
$record = M('sociaty_games', 'tab_')->where(['game_id' => $game['id'], 'promote_id' => $topPromote['id']])->find();
if ($record['status'] == 1) {
return true;
} else {
return false;
}
}
}

@ -1622,17 +1622,28 @@ class ApplyController extends BaseController
$gameData['sdk_name'] = getSDKTypeName($gameData['sdk_version']);
$promoteIds = getAllPromoteListByType($promoteType);
$promotes = getAllPromoteListByType($promoteType);
M('apply', 'tab_')->where(array('game_id' => $gameId, 'promote_id' => $value['id'], 'offline_status' => 0))->count('id');
$newPromoteData = [];
if (count($promoteIds) > 0) {
foreach ($promoteIds as $value) {
if (count($promotes) > 0) {
$promoteIds = array_column($promotes, 'id');
$oldIds = M('apply', 'tab_')->where(['game_id' => $gameId, 'promote_id' => ['in', $promoteIds], 'offline_status' => 0])->getField('id', true);
$newPromoteIds = array_diff($promoteIds, $oldIds);
foreach ($promotes as $promote) {
if (in_array($promote['id'], $newPromoteIds)) {
$newPromoteData[] = $promote;
}
}
/* foreach ($promoteIds as $value) {
$thisPromote = M('apply', 'tab_')->where(array('game_id' => $gameId, 'promote_id' => $value['id'], 'offline_status' => 0))->count('id');
if (!$thisPromote) {
$newPromoteData[] = $value;
}
}
} */
}
$data['game_data'] = $gameData;

@ -154,8 +154,8 @@ class HomeController extends Controller
$this->error('该链接已被禁');
}
if ($code != '') {
$applyService = new ApplyService();
if ($code != '') {
$data = $applyService->decodeApplyCode($code);
$result = $applyService->checkApplyCode($data, ApplyService::ENCRYPT_TYPE_LANDING_PAGE);
if (!$result['status']) {
@ -194,6 +194,11 @@ class HomeController extends Controller
$map = ['id' => intval($gameId)];
$game = M('game', 'tab_')->field($columns)->where($map)->find();
$promote = M('promote', 'tab_')->field(['id', 'parent_id', 'chain', 'level'])->where(['id' => $promoteId])->find();
if (!$applyService->checkSociatyPerm($promote, $game)) {
$this->error('该链接已经停止使用');
}
if ($game['sdk_version'] == 1 && $isIOS) {
$map = [];
$map['relation_game_id'] = $game['relation_game_id'];
@ -208,6 +213,9 @@ class HomeController extends Controller
$apply = M('apply', 'tab_')->field(['game_id', 'enable_status', 'promote_id'])
->where(['promote_id' => $promoteId, 'game_id' => $game['id']])
->find();
if (!$apply) {
$this->error('该链接已经停止使用');
}
$game['icon'] = get_cover($game['icon'], 'path');
$gameSource = M('GameSource', 'tab_')->field(['create_time', 'org_plist_url', 'is_new_sdk'])->where(array('game_id' => $game['id']))->find();

@ -40,8 +40,9 @@ class PackageController extends Controller
if ($isBlack) {
$this->redirect("package/downloadError", ['message' => '该链接已被禁']);
}
if ($code != '') {
$applyService = new ApplyService();
if ($code != '') {
$data = $applyService->decodeApplyCode($code);
$result = $applyService->checkApplyCode($data, ApplyService::ENCRYPT_TYPE_DOWNLOAD);
if (!$result['status']) {
@ -59,7 +60,16 @@ class PackageController extends Controller
$map['promote_id'] = $promoteId;
$columns = ['game_id', 'promote_id', 'promote_account', 'pack_url', 'plist_url', 'status', 'enable_status'];
$apply = M('apply','tab_')->field($columns)->where($map)->find();
if (!$apply) {
$this->redirect("package/downloadError", ['message' => '该链接已经停止使用']);
}
$promote = M('promote', 'tab_')->field(['id', 'parent_id', 'chain', 'level'])->where(['id' => $promoteId])->find();
$game = M('game','tab_')->field(['id', 'game_name', 'sdk_version'])->where(['id' => $apply['game_id']])->find();
if (!$applyService->checkSociatyPerm($promote, $game)) {
$this->redirect("package/downloadError", ['message' => '该链接已经停止使用']);
}
if (Request::isMobile()) {
if (!Request::isAndroid() && $game['sdk_version'] == 1) {

Loading…
Cancel
Save