添加游戏更新

master
chenxiaojun 5 years ago
parent c0d5f9d10d
commit 4b29ec1b63

@ -125,7 +125,7 @@ class ApplyController extends BaseController
$join = '';
if ($parentPromoteId > 0) {
$map['tab_apply.promote_id'] = $parentPromoteId;
$map['tab_apply.promote_id'] = PID;
if (!empty($where)) {
$map['_logic'] = 'and';
$map['_complex'] = $where;
@ -888,7 +888,7 @@ class ApplyController extends BaseController
$gameRelationName = M('game', 'tab_')->where(array('id' => $_POST['game_id']))->getField('relation_game_name');
$gameData = M('game', 'tab_')
->field('tab_game.*')
->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'])
->join('tab_apply on tab_game.id = tab_apply.game_id and tab_apply.offline_status = 0 and tab_apply.promote_id = ' . PID)
->where(array('tab_game.relation_game_name' => $gameRelationName))
->select();
} else {
@ -901,7 +901,7 @@ class ApplyController extends BaseController
if ($promoteData['parent_id'] > 0) {
$gameData = M('game', 'tab_')
->field('tab_game.*')
->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'])
->join('tab_apply on tab_game.id = tab_apply.game_id and tab_apply.offline_status = 0 and tab_apply.promote_id = ' . PID)
->where($gameMap)->select();
} else {
$gameData = M('game', 'tab_')->where($gameMap)->select();
@ -1469,6 +1469,7 @@ class ApplyController extends BaseController
function getGameInfo()
{
$gameId = I('game_id');
$promoteType = I('promote_type');
$gameData = array();
if ($gameId > 0) {
@ -1481,7 +1482,6 @@ class ApplyController extends BaseController
$gameData['sdk_name'] = getSDKTypeName($gameData['sdk_version']);
$promoteType = 2;
$promoteData = D('Promote')->where(array('id' => PID))->find();
if ($promoteData['parent_id'] > 0 && $promoteData['grand_id'] == 0) {
$promoteType = 3;
@ -1530,7 +1530,7 @@ class ApplyController extends BaseController
foreach ($promoteIds as $value) {
$thisPromoteData = D('Promote')->where(array('id' => $value))->find();
if (empty($thisPromoteData) || $thisPromoteData['parent_id'] != PID) {
if (empty($thisPromoteData) || !hasPromotePermission(PID, $value)) {
$data['status'] = -1;
$data['msg'] = '渠道权限异常';

@ -239,7 +239,8 @@
<?php $qrcode = base64_encode(base64_encode('http://'.$httpHost.get_cover($vo['icon'],'path')));?>
<div class="game-operating" style="width: 25%;">
<if condition="$promoteRole == 1">
<span class="add-game" game-id="{$vo.id}" style="cursor: pointer;margin-right: 10px;"><u>添加下级游戏</u></span>
<span class="add-game" game-id="{$vo.id}" promote-type="2" style="cursor: pointer;margin-right: 10px;"><u>添加组长游戏</u></span>
<span class="add-game" game-id="{$vo.id}" promote-type="3" style="cursor: pointer;margin-right: 10px;"><u>添加推广员游戏</u></span>
</if>
<?php $downloadUrl = get_apply_dow_url($vo['id'],$vo['promote_id']);?>
<span class="game-link" data-qrcode="{:U('Apply/qrcode',['url'=>base64_encode(base64_encode($downloadUrl)),'logo'=>$qrcode])}" data-url="{$downloadUrl}" style="cursor: pointer;margin-right: 10px;"><u>复制下载链接</u></span>
@ -305,7 +306,7 @@
<div class="game-window-content">
<div class="game-window-content-eveyone">
<label>添加下级:</label>
<label id="add_promote_title">添加组长:</label>
<div class="">
<div id="add_promote_data">
@ -793,12 +794,13 @@
$('.add-game').on('click', function () {
var thisElement = $(this);
var gameId = thisElement.attr('game-id');
var promoteType = thisElement.attr('promote-type');
$.ajax({
type: "post",
url: "__URL__/getGameInfo",
dataType: "json",
data: {'game_id': gameId},
data: {'game_id': gameId,'promote_type':promoteType},
success: function (data) {
console.log(data);
$('#add_game_name').text(data.game_data.game_name);
@ -820,7 +822,11 @@
});
}
$.myMethod("#add_promote_data",tagData,"add_promote_ids")
if (promoteType == 3) {
$('#add_promote_title').text('添加推广员:');
}
$.myMethod("#add_promote_data",tagData,"add_promote_ids");
$(".sumbit").on("click",function(){
console.log($("form").serialize())
});

Loading…
Cancel
Save