区服列表 区服名称改区服id

master
chenzhi 5 years ago
parent 0f7134c838
commit 07f6e9919d

@ -44,9 +44,9 @@ class ServerController extends ThinkController {
unset($_REQUEST['game_name']); unset($_REQUEST['game_name']);
} }
} }
if(isset($_REQUEST['server_name'])){ if(isset($_REQUEST['server_id'])){
$extend['server_name']=$_REQUEST['server_name']; $extend['server_id']=$_REQUEST['server_id'];
unset($_REQUEST['server_name']); unset($_REQUEST['server_id']);
} }
if(empty($_GET['type']) || $_GET['type'] == 1) { if(empty($_GET['type']) || $_GET['type'] == 1) {
$extend['developers'] = array('EQ',0); $extend['developers'] = array('EQ',0);

@ -86,7 +86,7 @@
</select> </select>
</div> </div>
<div class="input-list input-list-server search_label_rehab"> <div class="input-list input-list-server search_label_rehab">
<select id="server_name" name="server_name" class="select_gallery" style="width:120px;"> <select id="server_id" name="server_id" class="select_gallery" style="width:120px;">
<option value="">区服名称</option> <option value="">区服名称</option>
</select> </select>
</div> </div>
@ -333,7 +333,7 @@ $(function(){
}); });
$("#server_version").change(); $("#server_version").change();
var game_server = "{:I('server_name')}"; var game_server = "{:I('server_id')}";
$("#game_name").change(function(){ $("#game_name").change(function(){
$.ajax({ $.ajax({
url:"{:U('Ajax/getGmeServer')}", url:"{:U('Ajax/getGmeServer')}",
@ -343,11 +343,11 @@ $(function(){
success:function(data){ success:function(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_server && data[i].server_id == game_server?'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