From 24c2ea0031d201ebd4f3889d23648a34d001e961 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 26 Dec 2019 15:38:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8C=BA=E6=9C=8D=E9=A2=84?= =?UTF-8?q?=E5=91=8A=E7=9A=84=E5=8C=BA=E6=9C=8D=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ServerNoticeController.class.php | 32 ++++++++++++++++++- .../Admin/View/ServerNotice/lists.html | 2 +- 2 files changed, 32 insertions(+), 2 deletions(-) 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',