diff --git a/Application/Admin/Controller/PlatformController.class.php b/Application/Admin/Controller/PlatformController.class.php index 24d2b4c87..0774439ec 100644 --- a/Application/Admin/Controller/PlatformController.class.php +++ b/Application/Admin/Controller/PlatformController.class.php @@ -640,7 +640,7 @@ class PlatformController extends ThinkController if (isset($_REQUEST['game_name'])) { $map['s.game_name'] = $_REQUEST['game_name']; if (isset($_REQUEST['server_id'])) { - $map['s.server_name'] = $_REQUEST['server_id']; + $map['s.server_id'] = $_REQUEST['server_id']; unset($_REQUEST['server_id']); } } @@ -1002,6 +1002,21 @@ class PlatformController extends ThinkController $this->display(); } + public function getSpendServer(){ + if(isset($_REQUEST['game_name'])){ + $game = M('Game','tab_')->field('id')->where(['game_name'=>$_REQUEST['game_name']])->find(); + $game_id = $game['id']; + + } + if(isset($_REQUEST['game_id'])){ + $game_id = $_REQUEST['game_id']; + } + $map['game_id'] = $game_id; + $map['server_name'] = array('neq',''); + $data = M('server','tab_')->field('server_name,server_id')->where($map)->group('server_name')->select(); + $this->AjaxReturn($data); + } + public function uc_deposit($p = 1) { if (isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])) { diff --git a/Application/Admin/View/Platform/promotepay_statistics.html b/Application/Admin/View/Platform/promotepay_statistics.html index ef0284de1..53fd236c2 100644 --- a/Application/Admin/View/Platform/promotepay_statistics.html +++ b/Application/Admin/View/Platform/promotepay_statistics.html @@ -353,15 +353,17 @@ // endDate:date }) $("#game_id").change(function(){ + console.log($("#game_id option:selected").attr('game-id')); $.ajax({ - url:"{:U('Ajax/getSpendServer')}", + url:"{:U('getSpendServer')}", type:"post", data:{game_id:$("#game_id option:selected").attr('game-id')}, dataType:'json', success:function(data){ + console.log(data) str = ""; for (var i in data){ - str += "" + str += "" } $("#server_id").empty(); $("#server_id").append(str); @@ -370,18 +372,20 @@ } }) }); - var game_id = "{:I('game_name')}"; + var game_name = "{:I('game_name')}"; var game_server = "{:I('server_id')}"; - if(game_id){ + if(game_name){ + console.log({game_name:game_name}) $.ajax({ - url:"{:U('Ajax/getSpendServer')}", + url:"{:U('getSpendServer')}", type:"post", - data:{game_id:game_id,type:2}, + data:{game_name:game_name}, dataType:'json', success:function(data){ + console.log(data) str = ""; for (var i in data){ - str += "" + str += "" } $("#server_id").empty(); $("#server_id").append(str);