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 @@