From 7a873a9d980300547f4c941d07833da22f095e2b Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 25 Nov 2019 20:22:27 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=B8=81=E5=8F=91?= =?UTF-8?q?=E6=94=BEbug=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/PromoteCoinController.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Application/Admin/Controller/PromoteCoinController.class.php b/Application/Admin/Controller/PromoteCoinController.class.php index 8bd39244f..a45cb9087 100644 --- a/Application/Admin/Controller/PromoteCoinController.class.php +++ b/Application/Admin/Controller/PromoteCoinController.class.php @@ -22,6 +22,7 @@ class PromoteCoinController extends ThinkController $extend['source_id'] = 0; $map = $extend; } else { + $extend['type'] = 1; $extend['promote_id'] = $_GET['promote_id']; $extend['promote_type'] = $_GET['promote_type']; From 965ad46dce0e36009bb1e16557f305c2b213a91b Mon Sep 17 00:00:00 2001 From: zhengchanglong Date: Mon, 25 Nov 2019 20:27:07 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E5=85=85=E5=80=BC=E6=B1=87=E6=80=BB?= =?UTF-8?q?=E5=AF=BC=E5=87=BABUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/RechargeSumController.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/RechargeSumController.class.php b/Application/Admin/Controller/RechargeSumController.class.php index 3c6b68fa8..a39b95b79 100644 --- a/Application/Admin/Controller/RechargeSumController.class.php +++ b/Application/Admin/Controller/RechargeSumController.class.php @@ -105,7 +105,7 @@ class RechargeSumController extends ThinkController } $count = count($data); - + $export_data = $data; $page = set_pagination($count, $row); if ($page) { $this->assign('_page', $page); @@ -122,7 +122,7 @@ class RechargeSumController extends ThinkController //判断是否执行导出 if (I('export') == 1) { - $this->exportSum($data); + $this->exportSum($export_data); } $this->assign('meta_title', "充值汇总"); $this->assign('list_data', $data); From ee095e306857c6af70aeb31a7ec83087782e76a0 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Mon, 25 Nov 2019 20:29:06 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?= =?UTF-8?q?=E6=B8=B8=E6=88=8F=E7=AE=A1=E7=90=86->=E5=85=85=E5=80=BC?= =?UTF-8?q?=E7=8E=A9=E5=AE=B6--=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/QueryController.class.php | 4 ++-- Data/update.sql | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index a81251bfc..dfda7397a 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1785,7 +1785,7 @@ class QueryController extends BaseController $map['_string'] = 'ui.role_id in(' . $subQuery . ')'; } - $orderBy = 'ui.play_time desc'; + $orderBy = 'play_time desc'; if (!empty($sortName)) { if (in_array($sortName, $sortNameData)) { $desc = ' desc'; @@ -1814,7 +1814,7 @@ class QueryController extends BaseController $field = $fieldUC . ',' . $fieldUI; $subQuery = M('user_play_data_count', 'tab_')->alias('uc') ->field($field) - ->join('tab_user_play_info as ui on ui.promote_id = uc.promote_id and ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id') + ->join('tab_user_play_info as ui on ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id') ->where($map) ->group('uc.role_id,uc.server_id,uc.game_id') ->buildSql(); diff --git a/Data/update.sql b/Data/update.sql index f247c096c..024e18c0e 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -559,3 +559,7 @@ ADD COLUMN `promote_id` int(11) NOT NULL DEFAULT 0 COMMENT '推广员ID'; ALTER TABLE `tab_user_play_data_count` DROP INDEX `search`, ADD INDEX `search`(`user_id`, `promote_id`, `game_id`, `server_id`, `role_id`, `create_time`) USING BTREE; + +--玩家角色表--添加索引 +ALTER TABLE `tab_user_play_info` +ADD INDEX `game_id`(`game_id`, `server_id`, `role_id`); \ No newline at end of file From 02ea000f2aa84a8142de576c4439257eddd12869 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Mon, 25 Nov 2019 20:29:59 +0800 Subject: [PATCH 04/11] charge --- .../Controller/DownloadController.class.php | 97 ++++++++----------- 1 file changed, 41 insertions(+), 56 deletions(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 30745ad83..281cdee41 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -1289,25 +1289,12 @@ class DownloadController extends BaseController { $levelPromote = $this->getLevelPromote(); $queryPromote = $this->getQueryPromote($levelPromote); - $map2[] = [ - '_logic' => 'or', - 'id' => $queryPromote['id'], - 'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'] - ]; + $map2['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']; $ids = M('promote', 'tab_')->where($map2)->getField('id', true); - if(empty($ids)) { - $ids = array(); - } - if(empty($levelPromote)) { - array_push($ids,PID); - } - // array_push($ids,$queryPromote['id']); - if (!empty($ids)) { - $map['promote_id'] = ['in',$ids]; - - }else { - $map['_string'] = '1<>1'; - } + $ids[] = $queryPromote['id']; + + $map = ['promote_id' => ['in', $ids]]; + $subMap = ['promote_id' => ['in', $ids]]; if ($gameId != 0) { $gameMap['relation_game_id'] = $gameId; @@ -1315,7 +1302,9 @@ class DownloadController extends BaseController { $gameMap['sdk_version'] = $sdkVersion; } $gameId1 = M('game', 'tab_')->where($gameMap)->getField('id', true); + $map['game_id'] = ['in', $gameId1]; + $subMap['game_id'] = ['in', $gameId1]; } if ($serverId != 0) { $map['server_id'] = $serverId; @@ -2816,21 +2805,33 @@ class DownloadController extends BaseController { $subMap = []; if(!empty($map['game_id'])) { $subMap['game_id'] = $map['game_id']; + $map['uc.game_id'] = $map['game_id']; + unset($map['game_id']); } if(!empty($map['server_id'])) { $subMap['server_id'] = $map['server_id']; + $map['ui.server_id'] = $map['server_id']; + unset($map['server_id']); + } + if(!empty($map['role_name'])) { + $map['ui.role_name'] = $map['role_name']; + unset($map['role_name']); + } + + if(!empty($map['user_account'])) { + $map['ui.user_account'] = $map['user_account']; + unset($map['user_account']); + } + if(!empty($map['promote_id'])) { + $map['uc.promote_id'] = $map['promote_id']; + unset($map['promote_id']); } $costBegin = $map['costbegin']; $costEnd = $map['costend']; unset($map['costbegin']); unset($map['costend']); - + $nowTime = strtotime(date('Y-m-d 00:00:00', time())); $subMap['create_time'] = ['between', [$map['begintime'], $map['endtime'] - 1]]; - $roleIdMap = $subMap; - $roleIds = M('user_play_data_count', 'tab_')->where($roleIdMap)->group('role_id')->getField('role_id', true); - if (count($roleIds) > 0) { - $map['role_id'] = ['in', $roleIds]; - } if ($costBegin != '' || $costEnd != '') { $having = ''; if ($costBegin != '' && $costEnd != '') { @@ -2845,40 +2846,24 @@ class DownloadController extends BaseController { ->group('game_id,server_id,role_id') ->having($having) ->buildSql(); - $map['_string'] = 'role_id in (' . $subQuery . ')'; - } - $spendMap['uc.create_time'] = ['between', [$map['begintime'], $map['endtime'] - 1]]; - $spendMap['_string'] = 'uc.game_id = tab_user_play_info.game_id and uc.server_id = tab_user_play_info.server_id and uc.role_id = tab_user_play_info.role_id'; - // $map['create_time'] = ['between', [strtotime(date('Y-m-d 00:00:00')) - 6*24*3600, strtotime(date('Y-m-d 23:59:59'))]]; - $sqlCost = M('user_play_data_count', 'tab_')->alias('uc') - ->field('sum(uc.recharge_cost) cost') - ->where($spendMap) - ->buildSql(); - - $sqlCount = M('user_play_data_count', 'tab_')->alias('uc') - ->field('sum(uc.recharge_count) count') - ->where($spendMap) - ->buildSql(); - - $spendMap['uc.create_time'] = ['between', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]]; - - $sqlTodayCost = M('user_play_data_count', 'tab_')->alias('uc') - ->field('sum(uc.recharge_count) count') - ->where($spendMap) - ->buildSql(); + $map['_string'] = 'ui.role_id in (' . $subQuery . ')'; + } + $map['uc.create_time'] = ['between', [$map['begintime'], $map['endtime'] - 1]]; unset($map['begintime']); unset($map['endtime']); - $subQuery = M('user_play_info', 'tab_') - ->field("*,$sqlCost as recharge_cost,$sqlCount as recharge_count,$sqlTodayCost as recharge_cost_today") - ->where($map) - ->having('recharge_cost > 0') - ->order('play_time desc') - ->buildSql(); - $roles = M()->field(' * ') - ->table($subQuery) - ->alias('a') - ->order('play_time desc') - ->select(); + //$spendMap['_string'] = 'uc.game_id = tab_user_play_info.game_id and uc.server_id = tab_user_play_info.server_id and uc.role_id = tab_user_play_info.role_id'; + $fieldUC = "sum(uc.recharge_cost) recharge_cost,sum(uc.recharge_count) recharge_count,sum(if(uc.create_time = {$nowTime},uc.recharge_cost,0)) as recharge_cost_today"; + $fieldUI = "ui.user_account,ui.game_name,ui.role_name,ui.role_level,ui.server_name,ui.play_time,ui.play_ip,ui.promote_account,ui.sdk_version"; + $field = $fieldUC . ',' . $fieldUI; + $subQuery = M('user_play_data_count', 'tab_')->alias('uc') + ->field($field) + ->join('tab_user_play_info as ui on ui.promote_id = uc.promote_id and ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id') + ->where($map) + ->group('uc.role_id,uc.server_id,uc.game_id') + ->buildSql(); + $roles = M()->alias('record') + ->table($subQuery) + ->select(); foreach ($roles as $role) { $records[] = [ 'user_account' => encryption($role['user_account']), From fb6177d18763e501e7c640beed49f8b4e3951f0b Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 25 Nov 2019 20:30:34 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=B8=81=E5=85=85?= =?UTF-8?q?=E5=80=BCbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/View/Deposit/lists.html | 1 + 1 file changed, 1 insertion(+) diff --git a/Application/Admin/View/Deposit/lists.html b/Application/Admin/View/Deposit/lists.html index d78d1c67c..44a90f6f7 100644 --- a/Application/Admin/View/Deposit/lists.html +++ b/Application/Admin/View/Deposit/lists.html @@ -57,6 +57,7 @@ +
From fc126c0bbfd781fdbae1e1159ab84528fd9f448b Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 25 Nov 2019 20:31:21 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=B8=81=E5=85=85?= =?UTF-8?q?=E5=80=BCbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/DepositController.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Application/Admin/Controller/DepositController.class.php b/Application/Admin/Controller/DepositController.class.php index 0be20b08f..11bf889df 100644 --- a/Application/Admin/Controller/DepositController.class.php +++ b/Application/Admin/Controller/DepositController.class.php @@ -67,6 +67,7 @@ class DepositController extends ThinkController { unset($_REQUEST['pay_way']); } + if(isset($_REQUEST['pay_status'])){ $map['pay_status']=$_REQUEST['pay_status']; unset($_REQUEST['pay_status']); From 1966e0a2e812b549e67907f7b59f226dd5071b66 Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Mon, 25 Nov 2019 20:31:54 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/MemberController.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index 36fd51598..a20bc258a 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -124,8 +124,10 @@ class MemberController extends ThinkController } $game_map = ""; - - $game_map .= " and tab_user_play.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")"; + if (!empty($_REQUEST['game_name']) || !empty($_REQUEST['game_type'])) { + $game_map .= " and tab_user_play.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")"; + } + $spendprom .= " and ss.game_id in (".implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')).")"; if (isset($_REQUEST['server_name'])) { $spendprom .= " and ss.server_name like '{$_REQUEST['server_name']}%' "; From 96bf61ada02612e2eb0d62639083b93f01f9e1f9 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Mon, 25 Nov 2019 20:36:01 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E5=86=B2=E5=80=BC=E7=8E=A9=E5=AE=B6promo?= =?UTF-8?q?teid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/DownloadController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 281cdee41..07e77e5e9 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -2857,7 +2857,7 @@ class DownloadController extends BaseController { $field = $fieldUC . ',' . $fieldUI; $subQuery = M('user_play_data_count', 'tab_')->alias('uc') ->field($field) - ->join('tab_user_play_info as ui on ui.promote_id = uc.promote_id and ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id') + ->join('tab_user_play_info as ui on ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id') ->where($map) ->group('uc.role_id,uc.server_id,uc.game_id') ->buildSql(); From 777352f1bf50135c34c464afe1f322945215a145 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 25 Nov 2019 20:37:24 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=B8=81=E5=85=85?= =?UTF-8?q?=E5=80=BCbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/View/Deposit/lists.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Admin/View/Deposit/lists.html b/Application/Admin/View/Deposit/lists.html index 44a90f6f7..7fe8954f1 100644 --- a/Application/Admin/View/Deposit/lists.html +++ b/Application/Admin/View/Deposit/lists.html @@ -48,11 +48,11 @@ placeholder="订单号"/>
- -
-
From 6fcdfd2f31bc884db60bbaf0e9339e9df50f3f2b Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 25 Nov 2019 20:49:47 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/ExportController.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 34ffcab5b..cc38b611b 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -367,7 +367,11 @@ class ExportController extends Controller $game_map = ""; - $game_map .= " and tab_user_play.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")"; +// $game_map .= " and tab_user_play.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")"; + + if (!empty($_REQUEST['game_name']) || !empty($_REQUEST['game_type'])) { + $game_map .= " and tab_user_play.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")"; + } $spendprom = " and ss.game_id in (".implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')).")"; if (isset($_REQUEST['server_name'])) { From b9bc2a716245d70e1ca461c48f40146d9213a876 Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Mon, 25 Nov 2019 21:31:06 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/GameTypeController.class.php | 6 ++++++ Application/Admin/Controller/GiftbagController.class.php | 2 +- Application/Admin/Controller/PromoteController.class.php | 3 +++ Application/Admin/View/GameType/lists.html | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/GameTypeController.class.php b/Application/Admin/Controller/GameTypeController.class.php index 8094c4cc2..8b6a0f7ab 100644 --- a/Application/Admin/Controller/GameTypeController.class.php +++ b/Application/Admin/Controller/GameTypeController.class.php @@ -25,8 +25,12 @@ class GameTypeController extends ThinkController { if(isset($request['status_show'])){ if($request['status_show']!='all'){ $extend['status_show'] = $request['status_show']; + } else { + unset($extend['status_show']); } unset($request['status_show']); + } else { + unset($extend['status_show']); } $this->m_title = '游戏类型'; @@ -40,6 +44,8 @@ class GameTypeController extends ThinkController { if(isset($request['status_show'])){ if($request['status_show']!='all'){ $extend['status'] = $request['status_show']; + } else { + unset($extend['status']); } unset($request['status_show']); } diff --git a/Application/Admin/Controller/GiftbagController.class.php b/Application/Admin/Controller/GiftbagController.class.php index 47842dc2f..10f854751 100644 --- a/Application/Admin/Controller/GiftbagController.class.php +++ b/Application/Admin/Controller/GiftbagController.class.php @@ -88,7 +88,7 @@ class GiftbagController extends ThinkController { $map['sdk_version'] = $_REQUEST['sdk_version']; $game_ids = M('game','tab_')->field('id')->where($map)->select(); $game_ids = array_column($game_ids,'id'); - $extend['sdk_version'] = ['in',$game_ids]; + $extend['game_id'] = ['in',$game_ids]; unset($_REQUEST['sdk_version']); } } diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index 6313e3da0..570c257a6 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -63,6 +63,9 @@ unset($_REQUEST['parent_id']); $map['ba_id']=$_REQUEST['admin_id']; } } + if (I('status') || I('status', -1) == 0) { + $map['status'] = I('status'); + } if (I("promote_level")) { $map['level'] = I("promote_level"); } diff --git a/Application/Admin/View/GameType/lists.html b/Application/Admin/View/GameType/lists.html index 09a1bb77b..311902c52 100644 --- a/Application/Admin/View/GameType/lists.html +++ b/Application/Admin/View/GameType/lists.html @@ -39,7 +39,7 @@