游戏预充值

master
zhanglingsheng 5 years ago
parent a15e62988b
commit 24d47089dd

@ -96,6 +96,17 @@ class AjaxController extends ThinkController{
$this->AjaxReturn($data);
}
public function getGameVersion($game_name="")
{
if ($game_name) {
$map['relation_game_name'] = $game_name;
}else {
$this->AjaxReturn([]);
}
$data = M('Game','tab_')->field('sdk_version')->where($map)->select();
$this->AjaxReturn($data);
}
/**
* 获取游戏折扣
* @param $game_id

@ -68,8 +68,6 @@
<div class="input-list input-list-game search_label_rehab">
<select id="sdk_version" name="sdk_version" class="select_gallery" >
<option value="">设备类型</option>
<option value="1" <?php echo I('sdk_version') == 1 ? "selected" : ''?>>安卓</option>
<option value="2" <?php echo I('sdk_version') == 2 ? "selected" : ''?>>苹果</option>
</select>
</div>
<div class="input-list input-list-server search_label_rehab">
@ -217,7 +215,14 @@
layer.msg('时间间隔不能超过31天请重新选择日期');
return false;
}
var game_name = $("#game_name").val();
var sdk_version = $("#sdk_version").val();
var server_name = $("#server_name").val();
console.log(server_name)
if(game_name != '' && server_name == '') {
layer.msg('请选择区服');
return false;
}
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&" + $('.jssearch').find('select').serialize();
@ -430,7 +435,27 @@
});
$("#promote_level").change();
var game_server = "{:I('server_name')}";
var game_server = "{:I('game_version')}";
var sdk_version = "{:I('sdk_version')}";
$("#game_name").change(function(){
$.ajax({
url:"{:U('Ajax/getGameVersion')}",
type:"post",
data:{game_name:$("#game_name option:selected").val()},
dataType:'json',
success:function(data){
str = "<option value=''>请选择设备</option>";
for (var i in data){
var version_name = data[i].sdk_version == "1" ? '安卓' : '苹果'
str += "<option value='"+data[i].sdk_version+"' "+(data[i].sdk_version == sdk_version?'selected':'')+">"+version_name+"</option>"
}
$("#sdk_version").empty();
$("#sdk_version").append(str);
$("#sdk_version").select2();
}
})
});
$("#sdk_version").change(function(){
$.ajax({
url:"{:U('Ajax/getGmeServer')}",

Loading…
Cancel
Save