修改落地页/下载页

master
ELF 5 years ago
parent d2b7e91a64
commit 79f9801351

@ -197,4 +197,16 @@ class ApplyService {
parse_str($items['query'], $params); parse_str($items['query'], $params);
return $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;
}
}
} }

@ -66,11 +66,11 @@ class ApplyController extends BaseController
{ {
$loginPromote = $this->getLoginPromote(); $loginPromote = $this->getLoginPromote();
$promoteId = empty(I('promote_id')) ? $loginPromote['id'] : I('promote_id');//搜索的渠道ID $promoteId = empty(I('promote_id')) ? $loginPromote['id'] : I('promote_id'); //搜索的渠道ID
$promoteRole = empty(I('promote_role')) ? 1 : I('promote_role');//渠道角色 $promoteRole = empty(I('promote_role')) ? 1 : I('promote_role'); //渠道角色
$parentPromoteId = getParentPromoteId($promoteId);//上级渠道ID $parentPromoteId = getParentPromoteId($promoteId); //上级渠道ID
$grandPromoteId = getGrandPromoteId($promoteId);//本账号会长渠道ID $grandPromoteId = getGrandPromoteId($promoteId); //本账号会长渠道ID
$childGameAddPermission = getChildGameAddPermission($grandPromoteId);//游戏添加权限 $childGameAddPermission = getChildGameAddPermission($grandPromoteId); //游戏添加权限
$map['tab_game.online_status'] = 1;//开发者游戏上线状态 $map['tab_game.online_status'] = 1;//开发者游戏上线状态
$map['tab_game.down_port'] = 1;//游戏端口 第三方接口不能申请 $map['tab_game.down_port'] = 1;//游戏端口 第三方接口不能申请
@ -1622,17 +1622,28 @@ class ApplyController extends BaseController
$gameData['sdk_name'] = getSDKTypeName($gameData['sdk_version']); $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 = []; $newPromoteData = [];
if (count($promoteIds) > 0) { if (count($promotes) > 0) {
foreach ($promoteIds as $value) {
$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'); $thisPromote = M('apply', 'tab_')->where(array('game_id' => $gameId, 'promote_id' => $value['id'], 'offline_status' => 0))->count('id');
if (!$thisPromote) { if (!$thisPromote) {
$newPromoteData[] = $value; $newPromoteData[] = $value;
} }
} } */
} }
$data['game_data'] = $gameData; $data['game_data'] = $gameData;

@ -154,8 +154,8 @@ class HomeController extends Controller
$this->error('该链接已被禁'); $this->error('该链接已被禁');
} }
if ($code != '') {
$applyService = new ApplyService(); $applyService = new ApplyService();
if ($code != '') {
$data = $applyService->decodeApplyCode($code); $data = $applyService->decodeApplyCode($code);
$result = $applyService->checkApplyCode($data, ApplyService::ENCRYPT_TYPE_LANDING_PAGE); $result = $applyService->checkApplyCode($data, ApplyService::ENCRYPT_TYPE_LANDING_PAGE);
if (!$result['status']) { if (!$result['status']) {
@ -194,6 +194,11 @@ class HomeController extends Controller
$map = ['id' => intval($gameId)]; $map = ['id' => intval($gameId)];
$game = M('game', 'tab_')->field($columns)->where($map)->find(); $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) { if ($game['sdk_version'] == 1 && $isIOS) {
$map = []; $map = [];
$map['relation_game_id'] = $game['relation_game_id']; $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']) $apply = M('apply', 'tab_')->field(['game_id', 'enable_status', 'promote_id'])
->where(['promote_id' => $promoteId, 'game_id' => $game['id']]) ->where(['promote_id' => $promoteId, 'game_id' => $game['id']])
->find(); ->find();
if (!$apply) {
$this->error('该链接已经停止使用');
}
$game['icon'] = get_cover($game['icon'], 'path'); $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(); $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) { if ($isBlack) {
$this->redirect("package/downloadError", ['message' => '该链接已被禁']); $this->redirect("package/downloadError", ['message' => '该链接已被禁']);
} }
if ($code != '') {
$applyService = new ApplyService(); $applyService = new ApplyService();
if ($code != '') {
$data = $applyService->decodeApplyCode($code); $data = $applyService->decodeApplyCode($code);
$result = $applyService->checkApplyCode($data, ApplyService::ENCRYPT_TYPE_DOWNLOAD); $result = $applyService->checkApplyCode($data, ApplyService::ENCRYPT_TYPE_DOWNLOAD);
if (!$result['status']) { if (!$result['status']) {
@ -59,7 +60,16 @@ class PackageController extends Controller
$map['promote_id'] = $promoteId; $map['promote_id'] = $promoteId;
$columns = ['game_id', 'promote_id', 'promote_account', 'pack_url', 'plist_url', 'status', 'enable_status']; $columns = ['game_id', 'promote_id', 'promote_account', 'pack_url', 'plist_url', 'status', 'enable_status'];
$apply = M('apply','tab_')->field($columns)->where($map)->find(); $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(); $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::isMobile()) {
if (!Request::isAndroid() && $game['sdk_version'] == 1) { if (!Request::isAndroid() && $game['sdk_version'] == 1) {

Loading…
Cancel
Save