From 8a513767ddf7fff40447487c15e62f6fea032105 Mon Sep 17 00:00:00 2001 From: jbrazz <2436953959@qq.com> Date: Sat, 9 Nov 2019 15:35:19 +0800 Subject: [PATCH] upt --- Application/Admin/Common/function.php | 5 +- .../Controller/ExportController.class.php | 39 ++++++++--- .../Controller/FinanceController.class.php | 11 +-- .../Admin/Controller/GameController.class.php | 2 +- .../Controller/ProvideController.class.php | 11 ++- .../RechargeSumController.class.php | 4 +- .../Controller/ServerController.class.php | 2 +- .../Admin/Controller/UserController.class.php | 2 +- .../Admin/View/Finance/gameFinance.html | 54 +++++++-------- Application/Admin/View/Game/lists.html | 43 +++++++++++- Application/Admin/View/Promote/lists.html | 10 +-- Application/Admin/View/Provide/lists.html | 43 ++++++++++-- Application/Admin/View/Server/lists.html | 49 +++++++++---- Application/Admin/View/User/rolelist.html | 68 ++++++++++++++++--- 14 files changed, 253 insertions(+), 90 deletions(-) diff --git a/Application/Admin/Common/function.php b/Application/Admin/Common/function.php index dfb6b2a4c..ca3b96255 100644 --- a/Application/Admin/Common/function.php +++ b/Application/Admin/Common/function.php @@ -550,9 +550,10 @@ function getGameByName($game_name=null, $sdk_version=null) $map['relation_game_name'] = $game_name; } if ($sdk_version) { - $map['server_version'] = $sdk_version; + $map['sdk_version'] = $sdk_version; } - return D("Game")->where($map)->select(); + $result = D("Game")->where($map)->select(); + return $result; } function getTopPromote($promote_id) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 337e43bd6..8c016e316 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -38,7 +38,7 @@ class ExportController extends Controller //导出Excel function expUser($id) { - $xlsName = $_REQUEST['xlsname']; + $xlsName = $_REQUEST['xlsname']; switch ($id) { case 1: @@ -52,7 +52,7 @@ class ExportController extends Controller array('play_ip', "最后登录ip"), ); if (isset($_REQUEST['game_name'])) { - $map['game_name'] = trim($_REQUEST['game_name']); + $map['game_name'] = ['like', trim($_REQUEST['game_name'])."%"]; unset($_REQUEST['game_name']); } if (isset($_REQUEST['user_account'])) { @@ -599,14 +599,18 @@ class ExportController extends Controller unset($_REQUEST['start']); unset($_REQUEST['end']); } - if (isset($_REQUEST['game_name'])) { - if ($_REQUEST['game_name'] == L('All')) { + if(isset($_REQUEST['game_name'])){ + if($_REQUEST['game_name']=='全部'){ unset($_REQUEST['game_name']); - } else { - $map['game_name'] = $_REQUEST['game_name']; + }else{ + $map['tab_spend.game_id']= ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')]; unset($_REQUEST['game_name']); } } + if(isset($_REQUEST['server_name'])){ + $map['tab_spend.server_name']=$_REQUEST['server_name']; + unset($_REQUEST['server_name']); + } if (isset($_REQUEST['pay_order_number'])) { $map['pay_order_number'] = array('like', '%' . trim($_REQUEST['pay_order_number']) . '%'); unset($_REQUEST['pay_order_number']); @@ -623,6 +627,17 @@ class ExportController extends Controller $map['pay_game_status'] = $_REQUEST['pay_game_status']; unset($_REQUEST['pay_game_status']); } + if(isset($_REQUEST['promote_id'])) { + if ($_REQUEST['promote_id'] == 0) { + $map['promote_id'] = 0; + } else { + $map['_complex'] = ['tp.chain'=>['like', "%/{$_REQUEST['promote_id']}/%"], 'tp.id'=>$_REQUEST['promote_id'], '_logic' => 'or']; + } + $tab_promote_join = "left join tab_promote as tp on tp.id = tab_spend.promote_id"; + //unset($_REQUEST['promote_id']); + } else { + $tab_promote_join = false; + } $map1 = $map; $map1['pay_status'] = 1; $total = D('Spend')->where($map1)->sum('pay_amount'); @@ -634,6 +649,7 @@ class ExportController extends Controller $xlsData = D('Spend') ->field('pay_order_number,pay_time,user_account,game_name,promote_account,spend_ip,pay_amount,pay_amount,pay_status,pay_game_status,pay_way,server_name,game_player_name,cost') ->where($map) + ->join($tab_promote_join) ->order('pay_time DESC') ->select(); $xlsCell = array( @@ -3801,7 +3817,7 @@ if ($key == 'model'){ $model = M('game','tab_'); if(isset($_REQUEST['game_name'])){ - $map['game_name'] = $_REQUEST['game_name']; + $extend['game_name'] = ['like', "{$_REQUEST['game_name']}%"]; } if(isset($_REQUEST['sdk_version1'])){ $map['sdk_version']=$_REQUEST['sdk_version1']; @@ -4185,8 +4201,10 @@ if ($key == 'model'){ if(isset($_REQUEST['game_name'])){ if($_REQUEST['game_name']=='全部'){ + unset($_REQUEST['game_name']); }else{ - $map['game_name']=$_REQUEST['game_name']; + $extend['game_name']=['like', "{$_REQUEST['game_name']}%"]; + unset($_REQUEST['game_name']); } } @@ -5393,8 +5411,9 @@ if ($key == 'model'){ $map['promote_account'] = array('like','%'.I("root_name").'%'); } - if (!empty(I("game_id"))) { - $map['game_id'] = I("game_id"); + $game_ids = array_column(getGameByName(I("game_name"), I("sdk_type")), 'id'); + if ($game_ids) { + $map['game_id'] = ['in', $game_ids]; } if (!empty(I('partner_id'))) { diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index c4dcc6a47..90d95c622 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -139,9 +139,9 @@ class FinanceController extends ThinkController if (!empty(I('root_name'))) { $map['promote_account'] = array('like','%'.I("root_name").'%'); } - - if (!empty(I("game_id"))) { - $map['game_id'] = I("game_id"); + $game_ids = array_column(getGameByName(I("game_name"), I("sdk_type")), 'id'); + if ($game_ids) { + $map['game_id'] = ['in', $game_ids]; } if(!empty(I('root_id'))||I('root_id')=='0') { @@ -614,7 +614,10 @@ class FinanceController extends ThinkController if (I('partner_id')) { $map['partner_id'] = I('partner_id'); } - $data = M('game','tab_')->field("id,game_name")->where($map)->select(); + if (I('sdk_type')) { + $map['sdk_version'] = I('sdk_type'); + } + $data = M('game','tab_')->field("relation_game_name as game_name")->where($map)->group("relation_game_name")->select(); $this->ajaxReturn($data,'json'); } diff --git a/Application/Admin/Controller/GameController.class.php b/Application/Admin/Controller/GameController.class.php index bc58973ab..330d8ccf8 100644 --- a/Application/Admin/Controller/GameController.class.php +++ b/Application/Admin/Controller/GameController.class.php @@ -33,7 +33,7 @@ class GameController extends ThinkController public function lists() { if (isset($_REQUEST['game_name'])) { - $extend['game_name'] = $_REQUEST['game_name']; + $extend['game_name'] = ['like', "{$_REQUEST['game_name']}%"]; unset($_REQUEST['game_name']); } if (isset($_REQUEST['sdk_version1'])) { diff --git a/Application/Admin/Controller/ProvideController.class.php b/Application/Admin/Controller/ProvideController.class.php index 707d2be66..9a2088c03 100644 --- a/Application/Admin/Controller/ProvideController.class.php +++ b/Application/Admin/Controller/ProvideController.class.php @@ -35,13 +35,10 @@ class ProvideController extends ThinkController { $map['create_time'] = ['LT',strtotime(I('end'))+86399]; unset($_REQUEST['end']); } - if(isset($_REQUEST['game_name'])){ - if($_REQUEST['game_name']=='请选择'){ - unset($_REQUEST['game_name']); - }else{ - $map['game_name']=$_REQUEST['game_name']; - unset($_REQUEST['game_name']); - } + $game_ids = array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['sdk_version1']), 'id'); + if ($game_ids) { + $map['game_id'] = ['in', $game_ids]; + unset($_REQUEST['game_name'], $_REQUEST['sdk_version1']); } if(isset($_REQUEST['op_account'])){ if($_REQUEST['op_account']=='请选择'){ diff --git a/Application/Admin/Controller/RechargeSumController.class.php b/Application/Admin/Controller/RechargeSumController.class.php index 1686fa3f7..4a6055766 100644 --- a/Application/Admin/Controller/RechargeSumController.class.php +++ b/Application/Admin/Controller/RechargeSumController.class.php @@ -31,9 +31,9 @@ class RechargeSumController extends ThinkController{ if(isset($_REQUEST['promote_id'])){ if ($_REQUEST['promote_id'] > 0) { $promoter_ids = D("Promote")->where("chain like '%/{$_REQUEST['promote_id']}/%' or id={$_REQUEST['promote_id']}")->field('id')->select(); - $promoter_ids ? $rmap['promote_id'] = $map['promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))] : null; + $promoter_ids ? $rmap['tab_user.promote_id'] = $map['promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))] : null; } else { - $rmap['promote_id'] = $map['promote_id'] = 0; + $rmap['tab_user.promote_id'] = $map['promote_id'] = 0; } } diff --git a/Application/Admin/Controller/ServerController.class.php b/Application/Admin/Controller/ServerController.class.php index ea6a9dcbb..62c198fbc 100644 --- a/Application/Admin/Controller/ServerController.class.php +++ b/Application/Admin/Controller/ServerController.class.php @@ -35,7 +35,7 @@ class ServerController extends ThinkController { if($_REQUEST['game_name']=='全部'){ unset($_REQUEST['game_name']); }else{ - $extend['game_name']=$_REQUEST['game_name']; + $extend['game_name']=['like', "{$_REQUEST['game_name']}%"]; unset($_REQUEST['game_name']); } } diff --git a/Application/Admin/Controller/UserController.class.php b/Application/Admin/Controller/UserController.class.php index c4124f626..ed47e784a 100644 --- a/Application/Admin/Controller/UserController.class.php +++ b/Application/Admin/Controller/UserController.class.php @@ -558,7 +558,7 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){ { $map = []; if (isset($_REQUEST['game_name'])) { - $map['game_name'] = trim($_REQUEST['game_name']); + $map['game_name'] = ['like', trim($_REQUEST['game_name'])."%"]; unset($_REQUEST['game_name']); } if (isset($_REQUEST['server_id'])) { diff --git a/Application/Admin/View/Finance/gameFinance.html b/Application/Admin/View/Finance/gameFinance.html index 9d1d4f65c..5b6291597 100644 --- a/Application/Admin/View/Finance/gameFinance.html +++ b/Application/Admin/View/Finance/gameFinance.html @@ -89,12 +89,19 @@
- + +
+
+
@@ -259,45 +266,32 @@ }); }); - $("#partner_id").change(function(){ + function get_game_list() + { + var game_name = "{:I('game_name')}"; $.ajax({ url:"{:U('Finance/getGameList')}", type:"post", - data:{partner_id:$("#partner_id option:selected").attr('partner-id')}, + data:{partner_id:$("#partner_id option:selected").attr('partner-id'), sdk_type:$("#sdk_version1 option:selected").val()}, dataType:'json', success:function(data){ var str = ""; for (var i in data){ - str += "" + str += "" } // console.log(str); - $("#game_id").empty(); - $("#game_id").append(str); + $("#game_name").empty(); + $("#game_name").append(str); // $("#server_id").select2(); } }) + } + $("#partner_id, #sdk_type").change(function(){ + get_game_list(); }); - var game_id = "{:I('game_name')}"; - var game_server = "{:I('server_id')}"; - if(game_id){ - $.ajax({ - url:"{:U('Ajax/getSpendServer')}", - type:"post", - data:{game_id:game_id,type:2}, - dataType:'json', - success:function(data){ - str = ""; - for (var i in data){ - str += "" - } - $("#server_id").empty(); - $("#server_id").append(str); - $("#server_id").select2(); - } - }) - } + $("#partner_id").change(); }) diff --git a/Application/Admin/View/Game/lists.html b/Application/Admin/View/Game/lists.html index 56fac7fac..5991d6528 100644 --- a/Application/Admin/View/Game/lists.html +++ b/Application/Admin/View/Game/lists.html @@ -69,7 +69,7 @@ text-indent:0; -
+ +
+ +
+
+
- - - - + + + +
@@ -157,7 +157,7 @@ 注册时间 最后登录时间 渠道类型 - 上线会长 + 所属会长 商务专员 状态 可申请游戏 diff --git a/Application/Admin/View/Provide/lists.html b/Application/Admin/View/Provide/lists.html index 0f38f3a6a..977f4c48e 100644 --- a/Application/Admin/View/Provide/lists.html +++ b/Application/Admin/View/Provide/lists.html @@ -52,12 +52,19 @@ value="{:I('user_account')}">
- + + + + +
+
+ + +
@@ -334,5 +341,31 @@ }); }) + var game_name = "{:I('game_name')}"; + $("#sdk_version1").change(function(){ + $.ajax({ + url:"{:U('Ajax/getGameList')}", + type:"get", + data:{sdk_type:$("#sdk_version1 option:selected").val()}, + dataType:'json', + success:function(response){ + str = ''; + // $.each(response.data, function(index, item){ + // console.log(item.id); + // str += ''; + // }); + data = response.data; + for (var i in data){ + str += "" + } + $("#game_name").empty(); + $("#game_name").append(str); + $("#game_name").select2(); + $("#game_name").change(); + } + }) + }); + $("#sdk_version1").change(); + diff --git a/Application/Admin/View/Server/lists.html b/Application/Admin/View/Server/lists.html index dde7f9340..1f7f90a50 100644 --- a/Application/Admin/View/Server/lists.html +++ b/Application/Admin/View/Server/lists.html @@ -71,11 +71,18 @@
- + + + + +
+
+
@@ -85,14 +92,6 @@
-
-
-
   
- + + + + +
+
+
- -
- +
+