[bug]角色查询 无游戏区服全显示问题

master
chenzhi 5 years ago
parent 3500cce032
commit 2d2f3abf75

@ -281,21 +281,28 @@ $(".select_gallery").select2();
$("#promote_level").change(); $("#promote_level").change();
var game_id = "{:I('server_id')}"; var game_id = "{:I('server_id')}";
$("#game_type").change(function(){ $("#game_type").change(function(){
$.ajax({ var game_name = $("#game_name option:selected").val();
url:"{:U('Ajax/getGmeServer')}", if(game_name != ''){
type:"post", $.ajax({
data:{sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()}, url:"{:U('Ajax/getGmeServer')}",
dataType:'json', type:"post",
success:function(data){ data:{sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()},
str = "<option value=''>请选择区服</option>"; dataType:'json',
for (var i in data){ success:function(data){
str += "<option value='"+data[i].server_id+"' "+(game_id && data[i].server_id == game_id?'selected':'')+">"+data[i].server_name+"</option>" str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_id+"' "+(game_id && data[i].server_id == game_id?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
} }
$("#server_id").empty(); })
$("#server_id").append(str); }else{
$("#server_id").select2(); $("#server_id").html("");
} $("#server_id").append("<option value=''>请选择</option>");
}) }
}); });
$("#game_name").change(function(){ $("#game_name").change(function(){

Loading…
Cancel
Save