落地页、游戏下架更新

master
chenxiaojun 5 years ago
parent ca9f2baf1d
commit 2003c388d1

@ -220,6 +220,7 @@ function get_apply_dow_url($game_id = 0, $promote_id = 0)
$model = M('Apply', 'tab_'); $model = M('Apply', 'tab_');
$map['game_id'] = $game_id; $map['game_id'] = $game_id;
$map['promote_id'] = $promote_id; $map['promote_id'] = $promote_id;
$map['offline_status'] = 0;
$data = $model->where($map)->find(); $data = $model->where($map)->find();
if (empty($data['dow_url'])) { if (empty($data['dow_url'])) {
$game_address = M('game', 'tab_')->where('id=' . $game_id)->find(); $game_address = M('game', 'tab_')->where('id=' . $game_id)->find();
@ -812,7 +813,7 @@ function hasPromotePermission($parentId, $promoteId)
function isParentPromote($parentId, $promoteId) function isParentPromote($parentId, $promoteId)
{ {
$promoteParentId = D('Promote')->where('id', $promoteId)->getField('parent_id'); $promoteParentId = D('Promote')->where(array('id' => $promoteId))->getField('parent_id');
if ($promoteParentId == $parentId) { if ($promoteParentId == $parentId) {
return true; return true;
@ -893,8 +894,8 @@ function getAllPromoteIdsByType($promoteIds, $level = 3, $nowLevel = 1)
return ''; return '';
} }
//获取所有子渠道列表 $promoteId-渠道ID $promoteType-1:本账号 2:组长 3:推广员 //获取所有子渠道列表 $type 1-返回数组 2-返回id数组 3-返回id字符串
function getAllChildPromoteList() function getAllChildPromoteList($type = 1)
{ {
$childPromoteData = array(); $childPromoteData = array();
$childPromoteIds = getAllChildPromoteIds((string)PID); $childPromoteIds = getAllChildPromoteIds((string)PID);
@ -902,7 +903,17 @@ function getAllChildPromoteList()
if (!empty($childPromoteIds)) { if (!empty($childPromoteIds)) {
$map['id'] = ['in', $childPromoteIds]; $map['id'] = ['in', $childPromoteIds];
$childPromoteData = D('Promote')->where($map)->field('id,account,nickname')->select(); switch ($type) {
case 1:
$childPromoteData = D('Promote')->where($map)->field('id,account,nickname')->select();
break;
case 2:
$childPromoteData = D('Promote')->where($map)->getField('id');
break;
case 3:
$childPromoteData = $childPromoteIds;
break;
}
} }
return $childPromoteData; return $childPromoteData;
@ -980,7 +991,7 @@ function addedAboutDoubleSdk($promoteId, $gameId)
$map['tab_game.relation_game_id'] = $gameData['relation_game_id']; $map['tab_game.relation_game_id'] = $gameData['relation_game_id'];
if ($promoteData['parent_id'] == 0) { if ($promoteData['parent_id'] == 0) {
$count = M('Game', 'tab_') $count = M('Game', 'tab_')
->join('tab_apply on tab_game.id = tab_apply.game_id and tab_apply.promote_id = ' . $promoteId) ->join('tab_apply on tab_game.id = tab_apply.game_id and tab_apply.offline_status = 0 and tab_apply.promote_id = ' . $promoteId)
->where($map) ->where($map)
->count(); ->count();
@ -988,8 +999,8 @@ function addedAboutDoubleSdk($promoteId, $gameId)
} else { } else {
$applyData = M('Game', 'tab_') $applyData = M('Game', 'tab_')
->field('tab_game.id,ta_2.id as apply_id') ->field('tab_game.id,ta_2.id as apply_id')
->join('tab_apply as ta_1 on tab_game.id = ta_1.game_id and ta_1.promote_id = ' . $promoteData['parent_id']) ->join('tab_apply as ta_1 on tab_game.id = ta_1.game_id and ta_1.offline_status = 0 and ta_1.promote_id = ' . $promoteData['parent_id'])
->join('left join tab_apply as ta_2 on tab_game.id = ta_2.game_id and ta_2.promote_id = ' . $promoteId) ->join('left join tab_apply as ta_2 on tab_game.id = ta_2.game_id and ta_2.offline_status = 0 and ta_2.promote_id = ' . $promoteId)
->where($map) ->where($map)
->select(); ->select();

@ -57,10 +57,10 @@ class ApplyController extends BaseController
$parentPromoteId = getParentPromoteId($promoteId);//上级渠道ID $parentPromoteId = getParentPromoteId($promoteId);//上级渠道ID
$thisParentPromoteId = getParentPromoteId(PID);//本账号上级渠道ID $thisParentPromoteId = getParentPromoteId(PID);//本账号上级渠道ID
$addPermission = 1;//是否有添加游戏权限 // $addPermission = 1;//是否有添加游戏权限
if ($thisParentPromoteId == 0 && $promoteRole == 3) { // if ($thisParentPromoteId == 0 && $promoteRole == 3) {
$addPermission = 0; // $addPermission = 0;
} // }
$map['tab_game.online_status'] = 1;//开发者游戏上线状态 $map['tab_game.online_status'] = 1;//开发者游戏上线状态
$map['tab_game.down_port'] = 1;//游戏端口 第三方接口不能申请 $map['tab_game.down_port'] = 1;//游戏端口 第三方接口不能申请
@ -131,14 +131,14 @@ class ApplyController extends BaseController
$map['_complex'] = $where; $map['_complex'] = $where;
} }
$join = 'inner join tab_apply on tab_game.id = tab_apply.game_id ';//查询上级游戏 $join = 'inner join tab_apply on tab_game.id = tab_apply.game_id and tab_apply.offline_status = 0';//查询上级游戏
} }
$data = M('Game', 'tab_') $data = M('Game', 'tab_')
->field('tab_game.id,tab_game.icon,tab_game.game_name,tab_game.features,tab_game.sdk_version,tab_game.game_size,tab_game.game_type_name,tab_game.relation_game_name,ta_1.id as apply_id_1,ta_2.id as apply_id_2') ->field('tab_game.id,tab_game.icon,tab_game.game_name,tab_game.features,tab_game.sdk_version,tab_game.game_size,tab_game.game_type_name,tab_game.relation_game_name,ta_1.id as apply_id_1,ta_2.id as apply_id_2')
->join($join) ->join($join)
->join('left join tab_apply as ta_1 on tab_game.id = ta_1.game_id and ta_1.promote_id = ' . $promoteId)//查询是否拥有该游戏 ->join('left join tab_apply as ta_1 on tab_game.id = ta_1.game_id and ta_1.offline_status = 0 and ta_1.promote_id = ' . $promoteId)//查询是否拥有该游戏
->join('left join tab_apply as ta_2 on tab_game.relation_game_id = ta_2.game_id and tab_game.id != tab_game.relation_game_id and ta_2.promote_id = ' . $promoteId)//查询是否拥有关联游戏 ->join('left join tab_apply as ta_2 on tab_game.relation_game_id = ta_2.game_id and ta_2.offline_status = 0 and tab_game.id != tab_game.relation_game_id and ta_2.promote_id = ' . $promoteId)//查询是否拥有关联游戏
->join('left join tab_game_source on tab_game.id = tab_game_source.game_id')//查询游戏版本 ->join('left join tab_game_source on tab_game.id = tab_game_source.game_id')//查询游戏版本
->where($map) ->where($map)
->group($group) ->group($group)
@ -146,6 +146,9 @@ class ApplyController extends BaseController
->page($page, $row) ->page($page, $row)
->select(); ->select();
// var_dump($data);
// die;
/* 查询记录总数 */ /* 查询记录总数 */
$count = M("Game", "tab_") $count = M("Game", "tab_")
->field('tab_game.id') ->field('tab_game.id')
@ -175,7 +178,7 @@ class ApplyController extends BaseController
$this->assign('promoteRole', $promoteRole); $this->assign('promoteRole', $promoteRole);
$this->assign('pID', PID); $this->assign('pID', PID);
$this->assign('promoteData', getAllPromoteListByType($promoteRole)); $this->assign('promoteData', getAllPromoteListByType($promoteRole));
$this->assign('addPermission', $addPermission); // $this->assign('addPermission', $addPermission);
$this->assign('type', $type); $this->assign('type', $type);
$this->meta_title = "申请游戏"; $this->meta_title = "申请游戏";
@ -479,19 +482,17 @@ class ApplyController extends BaseController
} }
$applyMap['promote_id'] = $promoteId; $applyMap['promote_id'] = $promoteId;
$applyMap['offline_status'] = 0;
$gameIds = M('Apply', 'tab_')->where($applyMap)->getField('game_id', true); $gameIds = M('Apply', 'tab_')->where($applyMap)->getField('game_id', true);
$gameIds = implode(',', $gameIds); $gameIds = implode(',', $gameIds);
if (!empty($gameIds)) { if (empty($gameIds)) {
$map['_string'] = '1 = 2';
} else {
$map['tab_game.id'] = ['in', $gameIds]; $map['tab_game.id'] = ['in', $gameIds];
} }
$map['tab_apply.promote_id'] = $promoteId; $map['tab_apply.promote_id'] = $promoteId;
// if ($type < 0) {
// unset($map['status']);
// } else {
// $map['status'] = $type;
// }
if ($_REQUEST['game_id'] != null) { if ($_REQUEST['game_id'] != null) {
$relationGameName = M('Game', 'tab_')->where(array('id' => $_REQUEST['game_id']))->getField('relation_game_name'); $relationGameName = M('Game', 'tab_')->where(array('id' => $_REQUEST['game_id']))->getField('relation_game_name');
@ -887,7 +888,7 @@ class ApplyController extends BaseController
$gameRelationName = M('game', 'tab_')->where(array('id' => $_POST['game_id']))->getField('relation_game_name'); $gameRelationName = M('game', 'tab_')->where(array('id' => $_POST['game_id']))->getField('relation_game_name');
$gameData = M('game', 'tab_') $gameData = M('game', 'tab_')
->field('tab_game.*') ->field('tab_game.*')
->join('tab_apply on tab_game.id = tab_apply.game_id and tab_apply.promote_id = ' . $promoteData['parent_id']) ->join('tab_apply on tab_game.id = tab_apply.game_id and tab_apply.offline_status = 0 and tab_apply.promote_id = ' . $promoteData['parent_id'])
->where(array('tab_game.relation_game_name' => $gameRelationName)) ->where(array('tab_game.relation_game_name' => $gameRelationName))
->select(); ->select();
} else { } else {
@ -900,7 +901,7 @@ class ApplyController extends BaseController
if ($promoteData['parent_id'] > 0) { if ($promoteData['parent_id'] > 0) {
$gameData = M('game', 'tab_') $gameData = M('game', 'tab_')
->field('tab_game.*') ->field('tab_game.*')
->join('tab_apply on tab_game.id = tab_apply.game_id and tab_apply.promote_id = ' . $promoteData['parent_id']) ->join('tab_apply on tab_game.id = tab_apply.game_id and tab_apply.offline_status = 0 and tab_apply.promote_id = ' . $promoteData['parent_id'])
->where($gameMap)->select(); ->where($gameMap)->select();
} else { } else {
$gameData = M('game', 'tab_')->where($gameMap)->select(); $gameData = M('game', 'tab_')->where($gameMap)->select();
@ -912,11 +913,15 @@ class ApplyController extends BaseController
} }
foreach ($gameData as $list) { foreach ($gameData as $list) {
if (C('LAUNCH_SWITCH') == 0) { $updateStatus = 0;
$map['promote_id'] = $promoteId;
$map['game_id'] = $list['id']; $map['promote_id'] = $promoteId;
$result = M('apply', 'tab_')->where($map)->getField('id'); $map['game_id'] = $list['id'];
if ($result) { $result = M('apply', 'tab_')->field('id,offline_status')->where($map)->find();
if (!empty($result)) {
if ($result['offline_status'] == 1) {
$updateStatus = 1;
} else {
if ($_POST['sdk_type'] > 0) { if ($_POST['sdk_type'] > 0) {
continue; continue;
} else { } else {
@ -924,22 +929,30 @@ class ApplyController extends BaseController
} }
} }
} }
$model = new ApplyModel(); //D('Apply');
$ratio = $list['ratio']; $ratio = $list['ratio'];
$money = $list['money']; $money = $list['money'];
$sdk_version = $list['sdk_version'];
$model = new ApplyModel(); //D('Apply');
$data['game_id'] = $list['id'];
$data['game_name'] = get_game_name($list['id']);
$data['promote_id'] = $promoteId;
$data['promote_account'] = $promoteData['account'];
$data['apply_time'] = NOW_TIME;
$data['status'] = C('SET_AUTO_PACK');
$data['sdk_version'] = $sdk_version;
$data['ratio'] = $ratio; $data['ratio'] = $ratio;
$data['money'] = $money; $data['money'] = $money;
$res = $model->add($data); $data['promote_account'] = $promoteData['account'];
$data['apply_time'] = NOW_TIME;
$data['offline_status'] = 0;
if ($res) { if ($updateStatus == 0) {
$sdk_version = $list['sdk_version'];
$data['sdk_version'] = $sdk_version;
$data['game_id'] = $list['id'];
$data['game_name'] = get_game_name($list['id']);
$data['promote_id'] = $promoteId;
$data['status'] = C('SET_AUTO_PACK');
$res = $model->add($data);
} else {
$res = $model->where('id = ' . $result['id'])->save($data);
}
if (($updateStatus == 0 && $res) || ($updateStatus == 1 && $res !== false)) {
$thsiAppltId = M('Apply', 'tab_')->where(array('game_id' => $list['id'], 'promote_id' => $promoteId))->getField('id'); $thsiAppltId = M('Apply', 'tab_')->where(array('game_id' => $list['id'], 'promote_id' => $promoteId))->getField('id');
$gameSource = M('Game_source', 'tab_')->field('id,source_version')->where(['game_id' => $list['id']])->find(); $gameSource = M('Game_source', 'tab_')->field('id,source_version')->where(['game_id' => $list['id']])->find();
if (file_exists(get_game_source_file_url($list['id'])) || null == $gameSource) { if (file_exists(get_game_source_file_url($list['id'])) || null == $gameSource) {

@ -96,10 +96,17 @@ class HomeController extends Controller
public function promitionofregestion() public function promitionofregestion()
{ {
$RelationGameId = M('Game', 'tab_')->where(array('id' => $_GET['gid']))->getField('relation_game_id'); $gameData = M('Game', 'tab_')
->field('relation_game_id,sdk_version')
->where(array('id' => $_GET['gid']))
->find();
$RelationGameId = $gameData['relation_game_id'];
$gameSdkType = $gameData['sdk_version'];
$map['tab_game.relation_game_id'] = $RelationGameId; $map['tab_game.relation_game_id'] = $RelationGameId;
$map['ta.promote_id'] = $_GET['pid']; $map['ta.promote_id'] = $_GET['pid'];
$data = M('game', 'tab_')->field('tab_game.id,tab_game.sdk_version,tab_game.icon,tab_game.screenshot,tab_game.relation_game_id,tab_game.relation_game_name,ta.enable_status,tab_game.dow_status,tab_game.features,tab_game.flooring_page_imgs')->where($map)->join('tab_apply ta ON ta.game_id = tab_game.id and ta.promote_id=' . $_GET['pid'])->select(); $data = M('game', 'tab_')->field('tab_game.id,tab_game.sdk_version,tab_game.icon,tab_game.screenshot,tab_game.relation_game_id,tab_game.relation_game_name,ta.enable_status,tab_game.dow_status,tab_game.features,tab_game.flooring_page_imgs')->where($map)->join('tab_apply ta ON ta.game_id = tab_game.id and ta.offline_status = 0 and ta.promote_id=' . $_GET['pid'])->select();
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
if (!empty($value['flooring_page_imgs'])) { if (!empty($value['flooring_page_imgs'])) {
@ -108,6 +115,7 @@ class HomeController extends Controller
} }
$this->assign('data', $data); $this->assign('data', $data);
$this->assign('gameSdkType', $gameSdkType);
$this->display(); $this->display();
} }

@ -268,17 +268,13 @@
<if condition="addedAboutDoubleSdk($promoteId,$vo['id']) eq 1"> <if condition="addedAboutDoubleSdk($promoteId,$vo['id']) eq 1">
<span class="add-disable" style="cursor: pointer;">已添加</span> <span class="add-disable" style="cursor: pointer;">已添加</span>
<else/> <else/>
<if condition="$addPermission eq 1"> <span onclick="commonApply({$vo.id},this,0,10)" style="cursor: pointer;"><u>添加</u></span>
<span onclick="commonApply({$vo.id},this,0,10)" style="cursor: pointer;"><u>添加</u></span>
</if>
</if> </if>
<else/> <else/>
<if condition="$vo.apply_id_1 gt 0"> <if condition="$vo.apply_id_1 gt 0">
<span class="add-disable" style="cursor: pointer;">已添加</span> <span class="add-disable" style="cursor: pointer;">已添加</span>
<else/> <else/>
<if condition="$addPermission eq 1"> <span onclick="commonApply({$vo.id},this,0,0)" style="cursor: pointer;"><u>添加</u></span>
<span onclick="commonApply({$vo.id},this,0,0)" style="cursor: pointer;"><u>添加</u></span>
</if>
</if> </if>
</if> </if>
</div> </div>

@ -230,24 +230,18 @@
}); });
} }
}); });
$(".and_down").click(function () { $(".and_down").click(function () {
if (is_weixin() || is_ios()) { layer.msg('请使用安卓浏览器下载', {
layer.msg('请使用安卓浏览器下载', { <!-- icon: 7, -->
<!-- icon: 7, --> time: 2000 //2秒关闭如果不配置默认是3秒
time: 2000 //2秒关闭如果不配置默认是3秒 });
});
return false;
}
}); });
$(".iso_down").click(function () { $(".ios_down").click(function () {
if (is_weixin() || !is_ios()) { layer.msg('请使用苹果浏览器下载', {
layer.msg('请使用苹果浏览器下载', { <!-- icon: 7, -->
<!-- icon: 7, --> time: 2000 //2秒关闭如果不配置默认是3秒
time: 2000 //2秒关闭如果不配置默认是3秒 });
});
return false;
}
}); });
function is_weixin() { function is_weixin() {
@ -279,6 +273,22 @@
} }
} }
function isMobile() {
var userAgentInfo = navigator.userAgent;
var mobileAgents = [ "Android", "iPhone", "SymbianOS", "Windows Phone", "iPad","iPod"];
var mobile_flag = false;
//根据userAgent判断是否是手机
for (var v = 0; v < mobileAgents.length; v++) {
if (userAgentInfo.indexOf(mobileAgents[v]) > 0) {
mobile_flag = true;
break;
}
}
}
function getVs() { function getVs() {
var isIos = is_ios(); var isIos = is_ios();
var index = 3; var index = 3;
@ -296,6 +306,16 @@
<?php elseif (!empty($data[1]['sdk_version']) && $data[1]['sdk_version'] == 1) :?> <?php elseif (!empty($data[1]['sdk_version']) && $data[1]['sdk_version'] == 1) :?>
index = 2; index = 2;
<?php endif ;?> <?php endif ;?>
} else {
if (!isMobile()) {
<?php if ($gameSdkType == 1) :?>
$('.js_b').addClass('and_down');
$('.js_b').removeClass('js_b');
<?php else :?>
$('.js_b').addClass('ios_down');
$('.js_b').removeClass('js_b');
<?php endif ;?>
}
} }
} }

Loading…
Cancel
Save