新功能

master
ELF 5 years ago
parent 9f88ac7c11
commit 9e609c9278

@ -1216,8 +1216,11 @@ class QueryController extends BaseController
];
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
$promotes = $this->getGroupPromotes($promote);
$promotes = [];
$groupPromotes = $this->getGroupPromotes($promote);
if ($promote['parent_id'] > 0 && $promote['grand_id'] == 0) {
$promotes = $this->getNormalPromotes($promote);
}
$map = [];
$map = ['promote_id' => ['in', $ids]];
@ -1262,7 +1265,8 @@ class QueryController extends BaseController
} else {
if ($headmanPromoteId != 0) {
$map['promote_id'] = $headmanPromoteId;
} elseif ($promoteId != 0) {
}
if ($promoteId != 0) {
$map['promote_id'] = $promoteId;
}
}
@ -1271,6 +1275,8 @@ class QueryController extends BaseController
$games = $this->getGamesByPromote($promote);
$this->assign('promotes', $promotes);
$this->assign('groupPromotes', $groupPromotes);
$this->assign('games', $games);
$this->assign('records', $records);
$this->assign('pagination', $pagination);
@ -1298,8 +1304,11 @@ class QueryController extends BaseController
];
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
$promotes = $this->getGroupPromotes($promote);
$promotes = [];
$groupPromotes = $this->getGroupPromotes($promote);
if ($promote['parent_id'] > 0 && $promote['grand_id'] == 0) {
$promotes = $this->getNormalPromotes($promote);
}
$map = $spendMap = ['promote_id' => ['in' => $ids]];
if ($gameId != 0) {
@ -1324,7 +1333,8 @@ class QueryController extends BaseController
if ($headmanPromoteId != 0) {
$map['promote_id'] = $headmanPromoteId;
$spendMap['promote_id'] = $headmanPromoteId;
} elseif ($promoteId != 0) {
}
if ($promoteId != 0) {
$map['promote_id'] = $promoteId;
$spendMap['promote_id'] = $promoteId;
}
@ -1422,6 +1432,17 @@ class QueryController extends BaseController
]);
}
public function getSubPromotes()
{
$promoteId = I('promote_id', 0);
$promotes = M('promote', 'tab_')->field(['id', 'account'])->where(['parent_id' => $promoteId])->select();
$this->ajaxReturn([
'status' => 1,
'msg' => '成功',
'data' => ['promotes' => $promotes]
]);
}
/**
* [充值详细信息]
* @param $id [充值id]

@ -25,15 +25,15 @@
<div class="trunk-search clearfix">
<form action="{:U('Query/userRecharges',array('row'=>I('get.row')))}" method="post" enctype="multipart/form-data">
<div class="form-group normal_space">
<select name="game_id" class="reselect select_gallery" style="width: 220px;" >
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<option value="{$game.game_id}">{$game.game_name}</option>
<option value="{$game.game_id}" <if condition="I('game_id') === $game['id']">selected</if>>{$game.game_name}</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<select name="headman_promote_id" class="reselect select_gallery" style="width: 220px;" >
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择区服</option>
<volist name="groupPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}">{$promote.account}</option>
@ -49,7 +49,7 @@
</div>
<if condition="$grand_id eq 0">
<div class="form-group normal_space">
<select name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<select id="group-select" name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择推广员</option>
<volist name="promotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}">{$promote.account}</option>
@ -59,7 +59,7 @@
</if>
<if condition="$parent_id eq 0">
<div class="form-group normal_space">
<select name="headman_promote_id" class="reselect select_gallery" style="width: 220px;" >
<select id="promote-select" name="headman_promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择组长</option>
<volist name="groupPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}">{$promote.account}</option>
@ -151,77 +151,42 @@
<script type="text/javascript">
$(function(){
$(".select_gallery").select2();
$('.reset-password-btn').on({
click: function() {
var id = $(this).parents('tr').eq(0).attr('data-id')
layer.confirm('是否确认重置密码?', {icon: 3, title:'提示'}, function(index){
$('#game-select').on({
change: function name() {
var gameId = $('#game-select').val()
$.ajax({
url: "{:U('Promote/resetPassword')}",
data: {promote_id: id},
type: 'post',
url: "{:U('Query/getGameServers')}",
dataType: 'json',
data: {game_id: gameId},
success: function(response) {
layer.close(index)
if (response.status == 1) {
layer.open({
content: '重置密码成功,您的新密码为:' + response.data.password
})
} else {
layer.msg(response.msg)
}
}
})
})
$("#server-select").val(0).trigger("change")
var options = '<option value="0">请选择区服</option>'
for (var i in response.data.servers) {
var server = response.data.servers[i]
options += '<option value="' + server.id + '">' + server.server_name + '</option>'
}
})
$('.froze-btn').on({
click: function() {
var id = $(this).parents('tr').eq(0).attr('data-id')
layer.confirm('是否确认冻结帐号?', {icon: 3, title:'提示'}, function(index){
$.ajax({
url: "{:U('Promote/froze')}",
data: {promote_id: id},
type: 'post',
dataType: 'json',
success: function(response) {
layer.msg(response.msg, {time: 1000}, function() {
window.location.href = window.location.href
})
$('#server-select').html(options)
}
})
})
}
})
$('.unfreeze-btn').on({
click: function() {
var id = $(this).parents('tr').eq(0).attr('data-id')
layer.confirm('是否确认解冻帐号?', {icon: 3, title:'提示'}, function(index){
$('#group-select').on({
change: function name() {
var groupId = $('#group-select').val()
$.ajax({
url: "{:U('Promote/unfreeze')}",
data: {promote_id: id},
type: 'post',
url: "{:U('Query/getSubPromotes')}",
dataType: 'json',
data: {promote_id: groupId},
success: function(response) {
layer.msg(response.msg, {time: 1000}, function() {
window.location.href = window.location.href
})
$("#promote-select").val(0).trigger("change")
var options = '<option value="0">请选择推广员</option>'
for (var i in response.data.promotes) {
var promote = response.data.promotes[i]
options += '<option value="' + promote.id + '">' + promote.account + '</option>'
}
})
})
$('#promote-select').html(options)
}
})
$('.shift-btn').on({
click: function() {
var id = $(this).parents('tr').eq(0).attr('data-id')
layer.open({
title: '渠道迁移',
type: 1,
content: $('#shift-box'),
area: ['600px', '400px']
})
}
})
})

@ -24,9 +24,8 @@
<div class="trunk-content article">
<div class="trunk-search clearfix">
<form action="{:U('Query/userRoles',array('row'=>I('get.row')))}" method="post" enctype="multipart/form-data">
<div class="form-group normal_space">
<select name="game_id" class="reselect select_gallery" style="width: 220px;" >
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<option value="{$game.game_id}" <if condition="I('game_id') === $game['id']">selected</if>>{$game.game_name}</option>
@ -34,7 +33,7 @@
</select>
</div>
<div class="form-group normal_space">
<select name="server_id" class="reselect select_gallery" style="width: 220px;" >
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择区服</option>
<volist name="groupPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}">{$promote.account}</option>
@ -54,21 +53,21 @@
<div class="form-group normal_space">
<input type="text" name="user_account" class="txt normal_txt" id="uid" placeholder="请输入玩家账号" value="{:I('user_account')}">
</div>
<if condition="$grand_id eq 0">
<if condition="$parent_id eq 0">
<div class="form-group normal_space">
<select name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择推广员</option>
<volist name="promotes" id="promote">
<select id="group-select" name="headman_promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择组长</option>
<volist name="groupPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') === $promote['id']">selected</if>>{$promote.account}</option>
</volist>
</select>
</div>
</if>
<if condition="$parent_id eq 0">
<if condition="$grand_id eq 0">
<div class="form-group normal_space">
<select name="headman_promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择组长</option>
<volist name="groupPromotes" id="promote">
<select id="promote-select" name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择推广员</option>
<volist name="promotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') === $promote['id']">selected</if>>{$promote.account}</option>
</volist>
</select>
@ -151,7 +150,45 @@ $(function() {
mode: 'range',
locale: 'zh',
})
$('.select_gallery').select2();
$('.select_gallery').select2()
$('#game-select').on({
change: function name() {
var gameId = $('#game-select').val()
$.ajax({
url: "{:U('Query/getGameServers')}",
dataType: 'json',
data: {game_id: gameId},
success: function(response) {
$("#server-select").val(0).trigger("change")
var options = '<option value="0">请选择区服</option>'
for (var i in response.data.servers) {
var server = response.data.servers[i]
options += '<option value="' + server.id + '">' + server.server_name + '</option>'
}
$('#server-select').html(options)
}
})
}
})
$('#group-select').on({
change: function name() {
var groupId = $('#group-select').val()
$.ajax({
url: "{:U('Query/getSubPromotes')}",
dataType: 'json',
data: {promote_id: groupId},
success: function(response) {
$("#promote-select").val(0).trigger("change")
var options = '<option value="0">请选择推广员</option>'
for (var i in response.data.promotes) {
var promote = response.data.promotes[i]
options += '<option value="' + promote.id + '">' + promote.account + '</option>'
}
$('#promote-select').html(options)
}
})
}
})
})
</script>
</block>
Loading…
Cancel
Save