diff --git a/Application/Admin/Controller/ServerNoticeController.class.php b/Application/Admin/Controller/ServerNoticeController.class.php index 59725c784..8f6974eb1 100644 --- a/Application/Admin/Controller/ServerNoticeController.class.php +++ b/Application/Admin/Controller/ServerNoticeController.class.php @@ -225,7 +225,7 @@ class ServerNoticeController extends ThinkController { - /** + /** * 区服状态修改 * @author 鹿文学 */ @@ -252,6 +252,36 @@ class ServerNoticeController extends ThinkController { $this->error($msg.'失败'); } } + /*** + * 获取区服列表 + */ + public function getGameServer() + { + $game_name = $_REQUEST['game_name']; + $sdk_version = $_REQUEST['sdk_version']; + $game_map = []; + if ($game_name) { + $game_map['relation_game_name'] = $game_name; + }else { + $this->AjaxReturn([]); + } + if ($sdk_version) { + $map['server_version'] = $game_map['sdk_version'] = $sdk_version; + }else { + $this->AjaxReturn([]); + } + $game = M("Game", 'tab_')->where($game_map)->getField('id', true); + + // 获取版本信息 + $map = []; + if ($game) { + $map['game_id'] = ['in', $game]; + } else { + $map['game_id'] = ['in', [-1]]; + } + $data = M('ServerNotice', 'tab_')->field('id, server_name, server_id')->where($map)->group('server_name')->select(); + $this->AjaxReturn($data); + } diff --git a/Application/Admin/View/ServerNotice/lists.html b/Application/Admin/View/ServerNotice/lists.html index 220741070..453104687 100644 --- a/Application/Admin/View/ServerNotice/lists.html +++ b/Application/Admin/View/ServerNotice/lists.html @@ -334,7 +334,7 @@ $(function(){ var game_server = "{:I('server_name')}"; $("#game_name").change(function(){ $.ajax({ - url:"{:U('Ajax/getGmeServer')}", + url:"{:U('getGameServer')}", type:"post", data:{sdk_version:$("#server_version option:selected").val(), game_name:$("#game_name option:selected").val()}, dataType:'json',