|
|
|
@ -62,13 +62,13 @@ class ApplyController extends BaseController
|
|
|
|
|
//首页 $type-查询的游戏平台类型 0-全部 10-安卓+ios 2-ios 1-安卓
|
|
|
|
|
public function index($serverType = 1)
|
|
|
|
|
{
|
|
|
|
|
$promoteId = empty(I('promote_id')) ? PID : I('promote_id');//搜索的渠道ID
|
|
|
|
|
$loginPromote = $this->getLoginPromote();
|
|
|
|
|
|
|
|
|
|
$promoteId = empty(I('promote_id')) ? $loginPromote['id'] : I('promote_id');//搜索的渠道ID
|
|
|
|
|
$promoteRole = empty(I('promote_role')) ? 1 : I('promote_role');//渠道角色
|
|
|
|
|
$parentPromoteId = getParentPromoteId($promoteId);//上级渠道ID
|
|
|
|
|
$grandPromoteId = getGrandPromoteId($promoteId);
|
|
|
|
|
$grandPromoteId = empty($grandPromoteId) ? $parentPromoteId : $grandPromoteId;//本账号会长渠道ID
|
|
|
|
|
$grandPromoteId = getGrandPromoteId($promoteId);//本账号会长渠道ID
|
|
|
|
|
$childGameAddPermission = getChildGameAddPermission($grandPromoteId);//游戏添加权限
|
|
|
|
|
$thisParentPromoteId = getParentPromoteId(PID);//本账号上级渠道ID
|
|
|
|
|
|
|
|
|
|
$map['tab_game.online_status'] = 1;//开发者游戏上线状态
|
|
|
|
|
$map['tab_game.down_port'] = 1;//游戏端口 第三方接口不能申请
|
|
|
|
@ -183,11 +183,9 @@ class ApplyController extends BaseController
|
|
|
|
|
|
|
|
|
|
$this->assign('list_data', $data);
|
|
|
|
|
$this->assign("count", $count);
|
|
|
|
|
$this->assign('loginPromote', $loginPromote);
|
|
|
|
|
$this->assign("promoteId", $promoteId);
|
|
|
|
|
$this->assign('parentPromoteId', $parentPromoteId);
|
|
|
|
|
$this->assign('thisParentPromoteId', $thisParentPromoteId);
|
|
|
|
|
$this->assign('promoteRole', $promoteRole);
|
|
|
|
|
$this->assign('pID', PID);
|
|
|
|
|
$this->assign('promoteData', getAllPromoteListByType($promoteRole));
|
|
|
|
|
$this->assign('type', $type);
|
|
|
|
|
$this->assign('myGame', ($serverType == 1) ? 'specialMyGameList' : 'myGameList');
|
|
|
|
@ -248,13 +246,13 @@ class ApplyController extends BaseController
|
|
|
|
|
// $where['_logic']='or';
|
|
|
|
|
} else {
|
|
|
|
|
$where['_complex'] = $map;
|
|
|
|
|
if(empty($noDeveloperGameArr)) {
|
|
|
|
|
$where['tab_game.id'] = ['in','-100'];
|
|
|
|
|
}else {
|
|
|
|
|
$where['tab_game.id'] = ['in',$noDeveloperGameArr];
|
|
|
|
|
if (empty($noDeveloperGameArr)) {
|
|
|
|
|
$where['tab_game.id'] = ['in', '-100'];
|
|
|
|
|
} else {
|
|
|
|
|
$where['tab_game.id'] = ['in', $noDeveloperGameArr];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$where['_logic']='or';
|
|
|
|
|
$where['_logic'] = 'or';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data = M('Game', 'tab_')
|
|
|
|
@ -598,9 +596,11 @@ class ApplyController extends BaseController
|
|
|
|
|
|
|
|
|
|
public function my_game($serverType = 1)
|
|
|
|
|
{
|
|
|
|
|
$loginPromote = $this->getLoginPromote();
|
|
|
|
|
|
|
|
|
|
//渠道可申请游戏
|
|
|
|
|
if (empty($_REQUEST['promote_id'])) {
|
|
|
|
|
$promoteId = get_pid();
|
|
|
|
|
$promoteId = $loginPromote['id'];
|
|
|
|
|
} else {
|
|
|
|
|
$promoteId = $_REQUEST['promote_id'];
|
|
|
|
|
}
|
|
|
|
@ -689,10 +689,8 @@ class ApplyController extends BaseController
|
|
|
|
|
$this->assign("url", $url);
|
|
|
|
|
$this->assign("count", $count);
|
|
|
|
|
$this->assign("row", $row);
|
|
|
|
|
$this->assign('loginPromote', $loginPromote);
|
|
|
|
|
$this->assign('promoteId', $promoteId);
|
|
|
|
|
$this->assign('thisParentPromoteId', getParentPromoteId(PID));
|
|
|
|
|
$this->assign('parentPromoteId', getParentPromoteId($promoteId));
|
|
|
|
|
$this->assign('pID', PID);
|
|
|
|
|
$this->assign('promoteRole', $promoteRole);
|
|
|
|
|
$this->assign('promoteData', getAllPromoteListByType($promoteRole));
|
|
|
|
|
$this->assign('list_data', $data);
|
|
|
|
@ -1006,14 +1004,20 @@ class ApplyController extends BaseController
|
|
|
|
|
public function apply()
|
|
|
|
|
{
|
|
|
|
|
if ($_POST['game_id']) {
|
|
|
|
|
$loginPromote = $this->getLoginPromote();
|
|
|
|
|
$gameMap['tab_game.id'] = $_POST['game_id'];
|
|
|
|
|
|
|
|
|
|
$promoteId = I('promote_id');
|
|
|
|
|
if (empty($promoteId)) {
|
|
|
|
|
$promoteId = PID;
|
|
|
|
|
$promoteId = $loginPromote['id'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($promoteId == $loginPromote['id']) {
|
|
|
|
|
$promoteData = $loginPromote;
|
|
|
|
|
} else {
|
|
|
|
|
$promoteData = D('Promote')->where(array('id' => $promoteId))->find();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$grandPromoteId = getGrandPromoteId($promoteId);
|
|
|
|
|
$grandPromoteId = empty($grandPromoteId) ? $promoteData['parent_id'] : $grandPromoteId;//本账号会长渠道ID
|
|
|
|
|
$childGameAddPermission = getChildGameAddPermission($grandPromoteId);//游戏添加权限
|
|
|
|
@ -1594,6 +1598,7 @@ class ApplyController extends BaseController
|
|
|
|
|
switch ($promoteRole) {
|
|
|
|
|
case 2:
|
|
|
|
|
case 3:
|
|
|
|
|
case 4:
|
|
|
|
|
$data = getAllPromoteListByType($promoteRole);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@ -1617,11 +1622,6 @@ class ApplyController extends BaseController
|
|
|
|
|
|
|
|
|
|
$gameData['sdk_name'] = getSDKTypeName($gameData['sdk_version']);
|
|
|
|
|
|
|
|
|
|
$promoteData = D('Promote')->where(array('id' => PID))->find();
|
|
|
|
|
if ($promoteData['parent_id'] > 0 && $promoteData['grand_id'] == 0) {
|
|
|
|
|
$promoteType = 3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$promoteIds = getAllPromoteListByType($promoteType);
|
|
|
|
|
|
|
|
|
|
$newPromoteData = [];
|
|
|
|
@ -1643,6 +1643,7 @@ class ApplyController extends BaseController
|
|
|
|
|
|
|
|
|
|
function addGameToPromote()
|
|
|
|
|
{
|
|
|
|
|
$loginPromote = $this->getLoginPromote();
|
|
|
|
|
$gameId = I('game_id');
|
|
|
|
|
$promoteIds = I('promote_ids');
|
|
|
|
|
|
|
|
|
@ -1665,7 +1666,7 @@ class ApplyController extends BaseController
|
|
|
|
|
foreach ($promoteIds as $value) {
|
|
|
|
|
$thisPromoteData = D('Promote')->where(array('id' => $value))->find();
|
|
|
|
|
|
|
|
|
|
if (empty($thisPromoteData) || !hasPromotePermission(PID, $value)) {
|
|
|
|
|
if (empty($thisPromoteData) || !hasPromotePermission($loginPromote['id'], $value)) {
|
|
|
|
|
$data['status'] = -1;
|
|
|
|
|
$data['msg'] = '渠道权限异常';
|
|
|
|
|
|
|
|
|
|