[bug]角色查询区服不显示

master
chenzhi 5 years ago
parent 476ea0c889
commit bb09ef9005

@ -279,7 +279,7 @@ $(".select_gallery").select2();
}) })
}); });
$("#promote_level").change(); $("#promote_level").change();
var game_server = "{:I('server_name')}"; var game_id = "{:I('server_id')}";
$("#game_type").change(function(){ $("#game_type").change(function(){
$.ajax({ $.ajax({
url:"{:U('Ajax/getGmeServer')}", url:"{:U('Ajax/getGmeServer')}",
@ -287,13 +287,14 @@ $(".select_gallery").select2();
data:{sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()}, data:{sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()},
dataType:'json', dataType:'json',
success:function(data){ success:function(data){
console.log(data)
str = "<option value=''>请选择区服</option>"; str = "<option value=''>请选择区服</option>";
for (var i in data){ for (var i in data){
str += "<option value='"+data[i].server_name+"' "+(game_server && data[i].server_name == game_server?'selected':'')+">"+data[i].server_name+"</option>" str += "<option value='"+data[i].server_id+"' "+(game_id && data[i].server_id == game_id?'selected':'')+">"+data[i].server_name+"</option>"
} }
$("#server_name").empty(); $("#server_id").empty();
$("#server_name").append(str); $("#server_id").append(str);
$("#server_name").select2(); $("#server_id").select2();
} }
}) })
}); });

Loading…
Cancel
Save