优化行为日志区服名称为区服id

master
chenzhi 5 years ago
parent 432c84ba01
commit 5e08bda6c2

@ -29,10 +29,8 @@ class BehaviorLogController extends ThinkController
$game_id = ['in', array_column(getGameByName($params['game_name'], $params['sdk_version']), 'id')];
$map['game_id'] = $game_id;
}
if (isset($params['server_name'])) {
$game_id = M('game', 'tab_')->where(['relation_game_name' => $params['game_name'],'sdk_version' => $params['sdk_version']])->getField('id');
$server_id = M('server', 'tab_')->where(['server_name' => $params['server_name'], 'game_id' => $game_id])->getField('server_num');
$map['server_id'] = $server_id;
if (isset($params['server_id'])) {
$map['server_id'] =$params['server_id'];
}
if (isset($params['game_player_name'])) {
$map['game_player_name'] = $params['game_player_name'];

@ -73,7 +73,7 @@
</select>
</div>
<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>
</select>
</div>
@ -443,7 +443,7 @@
});
$("#promote_level").change();
var game_server = "{:I('server_name')}";
var game_server = "{:I('server_id')}";
$("#sdk_version").change(function(){
$.ajax({
url:"{:U('Ajax/getGmeServer')}",
@ -453,11 +453,11 @@
success:function(data){
str = "<option value=''>请选择区服</option>";
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_name").append(str);
$("#server_name").select2();
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
}
})
});

Loading…
Cancel
Save