From f0acbc1c242de7465a8cca15e715e33c4af346c7 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Tue, 14 Jan 2020 14:15:48 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=85=85=E5=80=BC=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E4=BC=9A=E9=95=BF=E6=9D=83=E9=99=90=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/BaseController.class.php | 43 +++++++++- .../Controller/CoinOrderController.class.php | 9 +- .../Controller/DownloadController.class.php | 86 +++++++++++-------- .../Controller/PromoteController.class.php | 11 +++ .../Home/Controller/QueryController.class.php | 52 ++++++----- .../Home/View/default/Promote/index.html | 8 ++ .../View/default/Public/promote_base.html | 13 ++- .../Home/View/default/Query/achievement.html | 4 + Data/update.sql | 4 + 9 files changed, 161 insertions(+), 69 deletions(-) diff --git a/Application/Home/Controller/BaseController.class.php b/Application/Home/Controller/BaseController.class.php index 31c126422..eda6e7e41 100644 --- a/Application/Home/Controller/BaseController.class.php +++ b/Application/Home/Controller/BaseController.class.php @@ -7,6 +7,14 @@ use Think\Controller; class BaseController extends HomeController { protected $loginPromote = null; + protected $canViewUserRecharge = true; + + protected $permControlUrls = [ + 'Home/Query/recharge', + 'Home/Players/playAction', + 'Home/Query/userRecharges', + 'Home/Query/arpu', + ]; protected function _initialize() { @@ -15,7 +23,7 @@ class BaseController extends HomeController $this->login(); $loginer = $this->getLoginPromote(); - $this->certifiCation(); + // $this->certifiCation(); $pid = is_login_promote(); define('PLEVEL', $loginer['parent_id']); define('PID', $pid); @@ -33,9 +41,13 @@ class BaseController extends HomeController define('G_SETTLEMENT_GRADE', 'sub_status,third_status'); } + $this->canViewUserRecharge = $this->promoteCan('view-user-recharge'); + $this->checkUrlPermission(); + $this->assign('loginer', $loginer); $this->assign("parent_id", $loginer['parent_id']); $this->assign("grand_id", $loginer['grand_id']); + $this->assign('canViewUserRecharge', $this->canViewUserRecharge); $result = M('site_apply', 'tab_')->where("promote_id=$pid")->getField('status'); if ($result['status'] == 1) { @@ -342,4 +354,33 @@ class BaseController extends HomeController break; } } + + public function checkUrlPermission() + { + $currentUrl = MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME; + if (!$this->canViewUserRecharge) { + foreach ($this->permControlUrls as $url) { + if (strtolower($currentUrl) == strtolower($url)) { + $this->error('无权限查看'); + } + } + } + } + + public function promoteCan($permission) + { + $promote = $this->getLoginPromote(); + if (!$promote) { + return false; + } + if ($permission == 'recharge') { + if ($promote['level'] == 1) { + return true; + } + } + if ($permission == 'view-user-recharge') { + return false; + } + return false; + } } diff --git a/Application/Home/Controller/CoinOrderController.class.php b/Application/Home/Controller/CoinOrderController.class.php index 652bb5556..1cd7cca4c 100644 --- a/Application/Home/Controller/CoinOrderController.class.php +++ b/Application/Home/Controller/CoinOrderController.class.php @@ -90,14 +90,7 @@ class CoinOrderController extends BaseController //创建订单 public function order_add(){ - - $status = promoteCan(session('promote_auth.pid'), function($level) { - if ($level == 1) { - return true; - } else { - return false; - } - }); + $status = $this->promoteCan('recharge'); if (!$status) { if (IS_POST) { $this->ajaxReturn(array('status' => 0, 'msg'=>'无权限操作')); diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 6d36d1428..09c430336 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -3016,22 +3016,22 @@ class DownloadController extends BaseController { public function achievementExcelInfo($tid,$map) { $xlsName = "推广员业绩"; $xlsCell = array( - array('account','账号'), - array('real_name','姓名'), - array('create_role_count','创角数'), - array('create_role_user_count','创角用户'), - array('new_create_role_user_count','新创角用户'), - array('new_create_role_ip_count','新创角ip'), - array('login_user_count','登陆用户数'), - array('recharge_user_count','充值人数'), - array('recharge_count','充值次数'), - array('recharge_amount','充值总额'), - array('recharge_by_ban_coin','绑定币充值'), - array('recharge_by_coin','通用币充值'), - array('recharge_by_cash','现金充值'), - - - ); + array('account','账号'), + array('real_name','姓名'), + array('create_role_count','创角数'), + array('create_role_user_count','创角用户'), + array('new_create_role_user_count','新创角用户'), + array('new_create_role_ip_count','新创角ip'), + array('login_user_count','登陆用户数'), + ); + if ($this->canViewUserRecharge) { + $xlsCell[] = array('recharge_user_count','充值人数'); + $xlsCell[] = array('recharge_count','充值次数'); + $xlsCell[] = array('recharge_amount','充值总额'); + $xlsCell[] = array('recharge_by_ban_coin','绑定币充值'); + $xlsCell[] = array('recharge_by_coin','通用币充值'); + $xlsCell[] = array('recharge_by_cash','现金充值'); + } $params['isContainSubs'] = $map['isContainSubs']; $params['basicPromotes'] = json_decode($map['basicPromotes'],TRUE); $ids = $map['ids']; @@ -3067,9 +3067,16 @@ class DownloadController extends BaseController { $newCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds($ids, $params); $newCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds($ids, $params); $loginUserCountList = $promoteRepository->getLoginUserCountByIds($ids, $params); - $rechargeCountList = $promoteRepository->getRechargeCountByIds($ids, $params); - $rechargeUserCountList = $promoteRepository->getRechargeUserCountByIds($ids, $params); - $rechargeAmountList = $promoteRepository->getRechargeAmountByIds($ids, $params); + + $rechargeCountList = []; + $rechargeUserCountList = []; + $rechargeAmountList = []; + if ($this->canViewUserRecharge) { + $rechargeCountList = $promoteRepository->getRechargeCountByIds($ids, $params); + $rechargeUserCountList = $promoteRepository->getRechargeUserCountByIds($ids, $params); + $rechargeAmountList = $promoteRepository->getRechargeAmountByIds($ids, $params); + } + $records = []; if (I('p', 1) == 1) { $selfParams = $params; @@ -3079,12 +3086,8 @@ class DownloadController extends BaseController { $selfNewCreateRoleUserCountList = $promoteRepository->getNewCreateRoleUserCountByIds([$parent['id']], $selfParams); // $selfNewCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds([$parent['id']], $selfParams); $selfNewCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds([$parent['id']], $selfParams); - $selfLoginUserCountList = $promoteRepository->getLoginUserCountByIds([$parent['id']], $selfParams); - $selfRechargeCountList = $promoteRepository->getRechargeCountByIds([$parent['id']], $selfParams); - $selfRechargeUserCountList = $promoteRepository->getRechargeUserCountByIds([$parent['id']], $selfParams); - $selfRechargeAmountList = $promoteRepository->getRechargeAmountByIds([$parent['id']], $selfParams); - $records[] = [ + $record = [ 'id' => $parent['id'], 'account' => $parent['account'], 'real_name' => $parent['real_name'], @@ -3095,18 +3098,24 @@ class DownloadController extends BaseController { // 'new_create_role_device_count' => $selfNewCreateRoleDeviceCountList[$parent['id']], 'new_create_role_ip_count' => $selfNewCreateRoleIpCountList[$parent['id']], 'login_user_count' => $selfLoginUserCountList[$parent['id']], - 'recharge_count' => $selfRechargeCountList[$parent['id']], - 'recharge_user_count' => $selfRechargeUserCountList[$parent['id']], - 'recharge_amount' => $selfRechargeAmountList[$parent['id']]['ban_coin'] + $selfRechargeAmountList[$parent['id']]['coin'] + $selfRechargeAmountList[$parent['id']]['cash'], - 'recharge_by_ban_coin' => $selfRechargeAmountList[$parent['id']]['ban_coin'], - 'recharge_by_coin' => $selfRechargeAmountList[$parent['id']]['coin'], - 'recharge_by_cash' => $selfRechargeAmountList[$parent['id']]['cash'], 'current_display' => $currentDisplay, ]; + if ($this->canViewUserRecharge) { + $selfRechargeCountList = $promoteRepository->getRechargeCountByIds([$parent['id']], $selfParams); + $selfRechargeUserCountList = $promoteRepository->getRechargeUserCountByIds([$parent['id']], $selfParams); + $selfRechargeAmountList = $promoteRepository->getRechargeAmountByIds([$parent['id']], $selfParams); + $record['recharge_count'] = $selfRechargeCountList[$parent['id']]; + $record['recharge_user_count'] = $selfRechargeUserCountList[$parent['id']]; + $record['recharge_amount'] = $selfRechargeAmountList[$parent['id']]['ban_coin'] + $selfRechargeAmountList[$parent['id']]['coin'] + $selfRechargeAmountList[$parent['id']]['cash']; + $record['recharge_by_ban_coin'] = $selfRechargeAmountList[$parent['id']]['ban_coin']; + $record['recharge_by_coin'] = $selfRechargeAmountList[$parent['id']]['coin']; + $record['recharge_by_cash'] = $selfRechargeAmountList[$parent['id']]['cash']; + } + $records[] = $record; } foreach ($promotes as $promote) { $id = $promote['id']; - $records[] = [ + $record = [ 'id' => $id, 'account' => $promote['account'], 'real_name' => $promote['real_name'], @@ -3117,14 +3126,17 @@ class DownloadController extends BaseController { 'new_create_role_device_count' => $newCreateRoleDeviceCountList[$id], 'new_create_role_ip_count' => $newCreateRoleIpCountList[$id], 'login_user_count' => $loginUserCountList[$id], - 'recharge_count' => $rechargeCountList[$id], - 'recharge_user_count' => $rechargeUserCountList[$id], - 'recharge_amount' => $rechargeAmountList[$id]['ban_coin'] + $rechargeAmountList[$id]['coin'] + $rechargeAmountList[$id]['cash'], - 'recharge_by_ban_coin' => $rechargeAmountList[$id]['ban_coin'], - 'recharge_by_coin' => $rechargeAmountList[$id]['coin'], - 'recharge_by_cash' => $rechargeAmountList[$id]['cash'], 'current_display' => '', ]; + if ($this->canViewUserRecharge) { + $record['recharge_count'] = $rechargeCountList[$id]; + $record['recharge_user_count'] = $rechargeUserCountList[$id]; + $record['recharge_amount'] = $rechargeAmountList[$id]['ban_coin'] + $rechargeAmountList[$id]['coin'] + $rechargeAmountList[$id]['cash']; + $record['recharge_by_ban_coin'] = $rechargeAmountList[$id]['ban_coin']; + $record['recharge_by_coin'] = $rechargeAmountList[$id]['coin']; + $record['recharge_by_cash'] = $rechargeAmountList[$id]['cash']; + } + $records[] = $record; } $xlsData = []; foreach ($records as $key1 => $value1) { diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index 36055ccf8..d52dbba71 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -557,6 +557,17 @@ class PromoteController extends BaseController ->where("qmn.status=0") ->order("qmn.id asc") ->select(); + + if (!$this->canViewUserRecharge) { + foreach ($data_list as $key => $item) { + foreach ($this->permControlUrls as $url) { + if (stripos($item['url'], $url) !== false) { + unset($data_list[$key]); + } + } + } + } + $this->assign("data_list", $data_list); $this->meta_title = "快捷菜单"; $this->display(); diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 660ccec8a..b36ad80ae 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -2093,9 +2093,15 @@ class QueryController extends BaseController // $newCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds($ids, $params); $newCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds($ids, $params); $loginUserCountList = $promoteRepository->getLoginUserCountByIds($ids, $params); - $rechargeCountList = $promoteRepository->getRechargeCountByIds($ids, $params); - $rechargeUserCountList = $promoteRepository->getRechargeUserCountByIds($ids, $params); - $rechargeAmountList = $promoteRepository->getRechargeAmountByIds($ids, $params); + + $rechargeCountList = []; + $rechargeUserCountList = []; + $rechargeAmountList = []; + if ($this->canViewUserRecharge) { + $rechargeCountList = $promoteRepository->getRechargeCountByIds($ids, $params); + $rechargeUserCountList = $promoteRepository->getRechargeUserCountByIds($ids, $params); + $rechargeAmountList = $promoteRepository->getRechargeAmountByIds($ids, $params); + } if (I('p', 1) == 1) { $selfParams = $params; @@ -2106,10 +2112,7 @@ class QueryController extends BaseController // $selfNewCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds([$parent['id']], $selfParams); $selfNewCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds([$parent['id']], $selfParams); $selfLoginUserCountList = $promoteRepository->getLoginUserCountByIds([$parent['id']], $selfParams); - $selfRechargeCountList = $promoteRepository->getRechargeCountByIds([$parent['id']], $selfParams); - $selfRechargeUserCountList = $promoteRepository->getRechargeUserCountByIds([$parent['id']], $selfParams); - $selfRechargeAmountList = $promoteRepository->getRechargeAmountByIds([$parent['id']], $selfParams); - $records[] = [ + $record = [ 'id' => $parent['id'], 'account' => $parent['account'], 'real_name' => $parent['real_name'], @@ -2120,18 +2123,24 @@ class QueryController extends BaseController // 'new_create_role_device_count' => $selfNewCreateRoleDeviceCountList[$parent['id']], 'new_create_role_ip_count' => $selfNewCreateRoleIpCountList[$parent['id']], 'login_user_count' => $selfLoginUserCountList[$parent['id']], - 'recharge_count' => $selfRechargeCountList[$parent['id']], - 'recharge_user_count' => $selfRechargeUserCountList[$parent['id']], - 'recharge_amount' => $selfRechargeAmountList[$parent['id']]['ban_coin'] + $selfRechargeAmountList[$parent['id']]['coin'] + $selfRechargeAmountList[$parent['id']]['cash'], - 'recharge_by_ban_coin' => $selfRechargeAmountList[$parent['id']]['ban_coin'], - 'recharge_by_coin' => $selfRechargeAmountList[$parent['id']]['coin'], - 'recharge_by_cash' => $selfRechargeAmountList[$parent['id']]['cash'], 'current_display' => $currentDisplay, ]; + if ($this->canViewUserRecharge) { + $selfRechargeCountList = $promoteRepository->getRechargeCountByIds([$parent['id']], $selfParams); + $selfRechargeUserCountList = $promoteRepository->getRechargeUserCountByIds([$parent['id']], $selfParams); + $selfRechargeAmountList = $promoteRepository->getRechargeAmountByIds([$parent['id']], $selfParams); + $record['recharge_count'] = $selfRechargeCountList[$parent['id']]; + $record['recharge_user_count'] = $selfRechargeUserCountList[$parent['id']]; + $record['recharge_amount'] = $selfRechargeAmountList[$parent['id']]['ban_coin'] + $selfRechargeAmountList[$parent['id']]['coin'] + $selfRechargeAmountList[$parent['id']]['cash']; + $record['recharge_by_ban_coin'] = $selfRechargeAmountList[$parent['id']]['ban_coin']; + $record['recharge_by_coin'] = $selfRechargeAmountList[$parent['id']]['coin']; + $record['recharge_by_cash'] = $selfRechargeAmountList[$parent['id']]['cash']; + } + $records[] = $record; } foreach ($promotes as $promote) { $id = $promote['id']; - $records[] = [ + $record = [ 'id' => $id, 'account' => $promote['account'], 'real_name' => $promote['real_name'], @@ -2142,14 +2151,17 @@ class QueryController extends BaseController // 'new_create_role_device_count' => $newCreateRoleDeviceCountList[$id], 'new_create_role_ip_count' => $newCreateRoleIpCountList[$id], 'login_user_count' => $loginUserCountList[$id], - 'recharge_count' => $rechargeCountList[$id], - 'recharge_user_count' => $rechargeUserCountList[$id], - 'recharge_amount' => $rechargeAmountList[$id]['ban_coin'] + $rechargeAmountList[$id]['coin'] + $rechargeAmountList[$id]['cash'], - 'recharge_by_ban_coin' => $rechargeAmountList[$id]['ban_coin'], - 'recharge_by_coin' => $rechargeAmountList[$id]['coin'], - 'recharge_by_cash' => $rechargeAmountList[$id]['cash'], 'current_display' => '', ]; + if ($this->canViewUserRecharge) { + $record['recharge_count'] = $rechargeCountList[$id]; + $record['recharge_user_count'] = $rechargeUserCountList[$id]; + $record['recharge_amount'] = $rechargeAmountList[$id]['ban_coin'] + $rechargeAmountList[$id]['coin'] + $rechargeAmountList[$id]['cash']; + $record['recharge_by_ban_coin'] = $rechargeAmountList[$id]['ban_coin']; + $record['recharge_by_coin'] = $rechargeAmountList[$id]['coin']; + $record['recharge_by_cash'] = $rechargeAmountList[$id]['cash']; + } + $records[] = $record; } } else { $timeout = 1; diff --git a/Application/Home/View/default/Promote/index.html b/Application/Home/View/default/Promote/index.html index 406f23825..aa8c3c342 100644 --- a/Application/Home/View/default/Promote/index.html +++ b/Application/Home/View/default/Promote/index.html @@ -4,6 +4,7 @@
+ + + +
+ $isOpenQuery = true; + ?> - @@ -128,10 +133,12 @@ + + diff --git a/Application/Home/View/default/Query/achievement.html b/Application/Home/View/default/Query/achievement.html index 06106905f..24f66ec0e 100644 --- a/Application/Home/View/default/Query/achievement.html +++ b/Application/Home/View/default/Query/achievement.html @@ -83,12 +83,14 @@ 新创角IP 登录用户数 + 充值人数 充值次数 充值总额 现金充值 通用币充值 绑定币充值 + 操作 @@ -109,12 +111,14 @@ {$record.new_create_role_ip_count} {$record.login_user_count} + {$record.recharge_user_count} {$record.recharge_count} {$record.recharge_amount} {$record.recharge_by_cash} {$record.recharge_by_coin} {$record.recharge_by_ban_coin} + diff --git a/Data/update.sql b/Data/update.sql index df2614a60..6c924bd21 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1073,3 +1073,7 @@ CREATE TABLE `sys_document_pop_rules` ( `operater_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作者ID', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; + + +ALTER TABLE `tab_promote` +ADD COLUMN `can_view_recharge` tinyint(1) NOT NULL default 0 COMMENT '是否显示充值数据'; From 7a1cd5bc945f3e8169b77e5af02edbdc6214907b Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Tue, 14 Jan 2020 14:41:33 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=8C=E6=95=B4?= =?UTF-8?q?=E7=9A=84=E6=9D=83=E9=99=90=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/BaseController.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Application/Home/Controller/BaseController.class.php b/Application/Home/Controller/BaseController.class.php index eda6e7e41..9af51d297 100644 --- a/Application/Home/Controller/BaseController.class.php +++ b/Application/Home/Controller/BaseController.class.php @@ -3,9 +3,11 @@ namespace Home\Controller; use Think\Controller; +use Base\Service\PromoteService; class BaseController extends HomeController { + protected $promotePermissions; protected $loginPromote = null; protected $canViewUserRecharge = true; @@ -379,7 +381,11 @@ class BaseController extends HomeController } } if ($permission == 'view-user-recharge') { - return false; + $promoteService = new PromoteService(); + $topPromote = $promoteService->getTopPromote($promote); + if ($topPromote['can_view_recharge'] == 1) { + return true; + } } return false; } From 23f2334e451e51a438d83f9fd95efabcbce77f7d Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Tue, 14 Jan 2020 14:58:05 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=85=E5=80=BC?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PromoteController.class.php | 9 ++++++--- Application/Admin/View/Promote/belong.html | 17 +++++++++++++++- .../Admin/View/Promote/belong_add.html | 16 +++++++++++++++ .../Admin/View/Promote/belong_edit.html | 20 +++++++++++++++++++ Data/update.sql | 6 +++++- 5 files changed, 63 insertions(+), 5 deletions(-) diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index 1a8e4f3d8..c72ec9cd4 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -1235,7 +1235,7 @@ class PromoteController extends ThinkController $this->display(); } - public function belong_add($promote_id=null, $company_belong = null, $company_relation = null, $remark = null) + public function belong_add($promote_id=null, $company_belong = null, $company_relation = null, $remark = null, $can_view_recharge = null) { if (IS_POST) { if (empty($promote_id)) { @@ -1245,6 +1245,7 @@ class PromoteController extends ThinkController 'promote_id' => $promote_id, 'company_belong' => $company_belong, 'company_relation' => $company_relation, + 'can_view_recharge' => $can_view_recharge, 'verify_status' => 0, 'remark' => $remark, 'applicant_id' => getAdmin(), @@ -1271,7 +1272,7 @@ class PromoteController extends ThinkController } } - public function belong_edit($promote_id=null, $company_belong = null, $company_relation = null, $remark = null) + public function belong_edit($promote_id=null, $company_belong = null, $company_relation = null, $remark = null, $can_view_recharge = null) { if (IS_POST) { if (empty($promote_id)) { @@ -1281,6 +1282,7 @@ class PromoteController extends ThinkController 'promote_id' => $promote_id, 'company_belong' => $company_belong, 'company_relation' => $company_relation, + 'can_view_recharge' => $can_view_recharge, 'verify_status' => 0, 'remark' => $remark, 'applicant_id' => getAdmin(), @@ -1320,7 +1322,8 @@ class PromoteController extends ThinkController foreach ($promote_belongs as $promote_belong) { $update = [ 'company_belong' => $promote_belong['company_belong'], - 'company_relation' => $promote_belong['company_relation'] + 'company_relation' => $promote_belong['company_relation'], + 'can_view_recharge' => $promote_belong['can_view_recharge'], ]; $res = M("promote", "tab_") ->where("chain like '%/{$promote_belong['promote_id']}/%' or id={$promote_belong['promote_id']} ") diff --git a/Application/Admin/View/Promote/belong.html b/Application/Admin/View/Promote/belong.html index ae7200bee..14a1128cc 100644 --- a/Application/Admin/View/Promote/belong.html +++ b/Application/Admin/View/Promote/belong.html @@ -73,7 +73,13 @@ - +
+ +
@@ -100,6 +106,7 @@ 身份状态 内外团 归属状态 + 充值信息权限 申请时间 备注 审核 @@ -181,6 +188,14 @@ 只维护 + + + 禁止 + + + 开放 + + {:set_show_time($data['applicant_time'])} {$data['remark']} diff --git a/Application/Admin/View/Promote/belong_add.html b/Application/Admin/View/Promote/belong_add.html index 2f6e6b177..b8cc5467a 100644 --- a/Application/Admin/View/Promote/belong_add.html +++ b/Application/Admin/View/Promote/belong_add.html @@ -89,6 +89,22 @@ + + + 充值信息查看权限: + + + + + + + + + 备注: diff --git a/Application/Admin/View/Promote/belong_edit.html b/Application/Admin/View/Promote/belong_edit.html index d3eade694..f39d3750a 100644 --- a/Application/Admin/View/Promote/belong_edit.html +++ b/Application/Admin/View/Promote/belong_edit.html @@ -100,6 +100,26 @@ + + 充值信息查看权限: + + + + + + + + + 备注: diff --git a/Data/update.sql b/Data/update.sql index 6c924bd21..6c6158704 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1075,5 +1075,9 @@ CREATE TABLE `sys_document_pop_rules` ( ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; +-- 是否需要修复旧数据 ALTER TABLE `tab_promote` -ADD COLUMN `can_view_recharge` tinyint(1) NOT NULL default 0 COMMENT '是否显示充值数据'; +ADD COLUMN `can_view_recharge` tinyint(1) NOT NULL default 0 COMMENT '是否显示充值数据 0否 1是'; + +ALTER TABLE `tab_promote_belong` +ADD COLUMN `can_view_recharge` tinyint(1) NOT NULL default 0 COMMENT '是否显示充值数据 0否 1是'; From 4f63f4537429de04df7c598acef0511f867ff20e Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Tue, 14 Jan 2020 14:58:17 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0>?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86>=E6=AF=8F=E6=97=A5?= =?UTF-8?q?=E6=A6=82=E5=86=B5|=E6=95=B0=E6=8D=AE=E6=B1=87=E6=80=BB--?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/QueryController.class.php | 151 ++++++++++-------- .../Home/View/default/Query/dailySummary.html | 10 ++ .../Home/View/default/Query/summary.html | 6 + 3 files changed, 101 insertions(+), 66 deletions(-) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index b36ad80ae..9be211d91 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1128,15 +1128,17 @@ class QueryController extends BaseController $newDeviceNumList = $userRepository->getNewCreateRoleDeviceCountByDay($params);//新创角设备 $newIpNumList = $userRepository->getNewCreateRoleIpCountByDay($params);//新创角IP $loginUserNumList = $userRepository->getLoginCountGroupByDayNew($params);//登录用户数 - $spendUserNumList = $spendRepository->getPayUserCountGroupByDayNew($params);//充值人数 - $spendNumList = $spendRepository->getPayCountGroupByDay($params);//充值次数 - $spendAllAmountList = $spendRepository->getPayAmountGroupByDayAndType($params);//充值总额 - $params['pay_way'] = ['in', '1,2,3,4,5,6']; - $spendCashList = $spendRepository->getPayAmountGroupByDayAndType($params);//现金充值 - $params['pay_way'] = 0; - $spendGenericList = $spendRepository->getPayAmountGroupByDayAndType($params);//通用币充值 - $params['pay_way'] = -1; - $spendBindingList = $spendRepository->getPayAmountGroupByDayAndType($params);//绑定币充值 + if ($this->canViewUserRecharge) { + $spendUserNumList = $spendRepository->getPayUserCountGroupByDayNew($params);//充值人数 + $spendNumList = $spendRepository->getPayCountGroupByDay($params);//充值次数 + $spendAllAmountList = $spendRepository->getPayAmountGroupByDayAndType($params);//充值总额 + $params['pay_way'] = ['in', '1,2,3,4,5,6']; + $spendCashList = $spendRepository->getPayAmountGroupByDayAndType($params);//现金充值 + $params['pay_way'] = 0; + $spendGenericList = $spendRepository->getPayAmountGroupByDayAndType($params);//通用币充值 + $params['pay_way'] = -1; + $spendBindingList = $spendRepository->getPayAmountGroupByDayAndType($params);//绑定币充值 + } $allData['role_num'] = 0; $allData['user_num'] = 0; @@ -1144,17 +1146,19 @@ class QueryController extends BaseController $allData['new_device_num'] = 0; $allData['new_ip_num'] = 0; $allData['login_user_num'] = 0; - $allData['spend_user_num'] = 0; - $allData['spend_num'] = 0; - $allData['spend_all_amount'] = 0; - $allData['spend_cash'] = 0; - $allData['spend_generic'] = 0; - $allData['spend_binding'] = 0; - $allData['spend_discount'] = 0; - $allData['spend_voucher'] = 0; + if ($this->canViewUserRecharge) { + $allData['spend_user_num'] = 0; + $allData['spend_num'] = 0; + $allData['spend_all_amount'] = 0; + $allData['spend_cash'] = 0; + $allData['spend_generic'] = 0; + $allData['spend_binding'] = 0; + $allData['spend_discount'] = 0; + $allData['spend_voucher'] = 0; + } foreach ($dayList as $day) { $date = date('Ymd', strtotime($day)); - $records[] = [ + $record = [ 'day' => $date, 'role_num' => $roleNumList[$day], 'user_num' => $userNumList[$day], @@ -1162,14 +1166,6 @@ class QueryController extends BaseController 'new_device_num' => $newDeviceNumList[$day], 'new_ip_num' => $newIpNumList[$day], 'login_user_num' => $loginUserNumList[$day], - 'spend_user_num' => $spendUserNumList[$day], - 'spend_num' => $spendNumList[$day], - 'spend_all_amount' => $spendAllAmountList[$day], - 'spend_cash' => $spendCashList[$day], - 'spend_generic' => $spendGenericList[$day], - 'spend_binding' => $spendBindingList[$day], - 'spend_discount' => 0, - 'spend_voucher' => 0, ]; $allData['role_num'] += $roleNumList[$day]; @@ -1178,14 +1174,27 @@ class QueryController extends BaseController $allData['new_device_num'] += $newDeviceNumList[$day]; $allData['new_ip_num'] += $newIpNumList[$day]; $allData['login_user_num'] += $loginUserNumList[$day]; - $allData['spend_user_num'] += $spendUserNumList[$day]; - $allData['spend_num'] += $spendNumList[$day]; - $allData['spend_all_amount'] = bcadd($allData['spend_all_amount'], $spendAllAmountList[$day], 2); - $allData['spend_cash'] = bcadd($allData['spend_cash'], $spendCashList[$day], 2); - $allData['spend_generic'] = bcadd($allData['spend_generic'], $spendGenericList[$day], 2); - $allData['spend_binding'] = bcadd($allData['spend_binding'], $spendBindingList[$day], 2); - $allData['spend_discount'] = bcadd($allData['spend_discount'], 0, 2); - $allData['spend_voucher'] = bcadd($allData['spend_voucher'], 0, 2); + + if ($this->canViewUserRecharge) { + $record['spend_user_num'] = $spendUserNumList[$day]; + $record['spend_num'] = $spendNumList[$day]; + $record['spend_all_amount'] = $spendAllAmountList[$day]; + $record['spend_cash'] = $spendCashList[$day]; + $record['spend_generic'] = $spendGenericList[$day]; + $record['spend_binding'] = $spendBindingList[$day]; + $record['spend_discount'] = 0; + $record['spend_voucher'] = 0; + + $allData['spend_user_num'] += $spendUserNumList[$day]; + $allData['spend_num'] += $spendNumList[$day]; + $allData['spend_all_amount'] = bcadd($allData['spend_all_amount'], $spendAllAmountList[$day], 2); + $allData['spend_cash'] = bcadd($allData['spend_cash'], $spendCashList[$day], 2); + $allData['spend_generic'] = bcadd($allData['spend_generic'], $spendGenericList[$day], 2); + $allData['spend_binding'] = bcadd($allData['spend_binding'], $spendBindingList[$day], 2); + $allData['spend_discount'] = bcadd($allData['spend_discount'], 0, 2); + $allData['spend_voucher'] = bcadd($allData['spend_voucher'], 0, 2); + } + $records[] = $record; } foreach ($dayListReverse as $day) { $date = date('Ymd', strtotime($day)); @@ -1194,8 +1203,10 @@ class QueryController extends BaseController $summaryData['user_num'][] = $userNumList[$day]; $summaryData['new_user_num'][] = $newUserNumList[$day]; $summaryData['new_device_num'][] = $newDeviceNumList[$day]; - $summaryData['spend_user_num'][] = $spendUserNumList[$day]; - $summaryData['spend_all_amount'][] = $spendAllAmountList[$day]; + if ($this->canViewUserRecharge) { + $summaryData['spend_user_num'][] = $spendUserNumList[$day]; + $summaryData['spend_all_amount'][] = $spendAllAmountList[$day]; + } } } @@ -1314,18 +1325,20 @@ class QueryController extends BaseController $newDeviceNumList = $userRepository->getNewCreateRoleDeviceCountByGame($params);//新创角设备 $newIpNumList = $userRepository->getNewCreateRoleIpCountByGame($params);//新创角IP $loginUserNumList = $userRepository->getLoginCountGroupByGame($params);//登录用户数 - $spendUserNumList = $spendRepository->getPayUserCountGroupByGame($params);//充值人数 - $spendNumList = $spendRepository->getPayCountGroupByGame($params);//充值次数 - $spendAllAmountList = $spendRepository->getPayAmountGroupByGameAndType($params);//充值总额 - $params['pay_way'] = ['in', '1,2,3,4,5,6']; - $spendCashList = $spendRepository->getPayAmountGroupByGameAndType($params);//现金充值 - $params['pay_way'] = 0; - $spendGenericList = $spendRepository->getPayAmountGroupByGameAndType($params);//通用币充值 - $params['pay_way'] = -1; - $spendBindingList = $spendRepository->getPayAmountGroupByGameAndType($params);//绑定币充值 + if ($this->canViewUserRecharge) { + $spendUserNumList = $spendRepository->getPayUserCountGroupByGame($params);//充值人数 + $spendNumList = $spendRepository->getPayCountGroupByGame($params);//充值次数 + $spendAllAmountList = $spendRepository->getPayAmountGroupByGameAndType($params);//充值总额 + $params['pay_way'] = ['in', '1,2,3,4,5,6']; + $spendCashList = $spendRepository->getPayAmountGroupByGameAndType($params);//现金充值 + $params['pay_way'] = 0; + $spendGenericList = $spendRepository->getPayAmountGroupByGameAndType($params);//通用币充值 + $params['pay_way'] = -1; + $spendBindingList = $spendRepository->getPayAmountGroupByGameAndType($params);//绑定币充值 + } foreach ($data as &$list) { $gameId = $list['game_id']; - $records[] = [ + $record = [ 'game_id' => $gameId, 'game_name' => $list['game_name'], 'sdk_version' => $list['sdk_version'], @@ -1335,15 +1348,19 @@ class QueryController extends BaseController 'new_device_num' => $newDeviceNumList[$gameId], 'new_ip_num' => $newIpNumList[$gameId], 'login_user_num' => $loginUserNumList[$gameId], - 'spend_user_num' => $spendUserNumList[$gameId], - 'spend_num' => $spendNumList[$gameId], - 'spend_all_amount' => $spendAllAmountList[$gameId], - 'spend_cash' => $spendCashList[$gameId], - 'spend_generic' => $spendGenericList[$gameId], - 'spend_binding' => $spendBindingList[$gameId], - 'spend_discount' => 0, - 'spend_voucher' => 0, ]; + if ($this->canViewUserRecharge) { + $record['spend_user_num'] = $spendUserNumList[$gameId]; + $record['spend_num'] = $spendNumList[$gameId]; + $record['spend_all_amount'] = $spendAllAmountList[$gameId]; + $record['spend_cash'] = $spendCashList[$gameId]; + $record['spend_generic'] = $spendGenericList[$gameId]; + $record['spend_binding'] = $spendBindingList[$gameId]; + $record['spend_discount'] = 0; + $record['spend_voucher'] = 0; + } + + $records[] = $record; } $params['all_data'] = 1; $params['game_ids'] = $allGameIs; @@ -1353,18 +1370,20 @@ class QueryController extends BaseController $allData['new_device_num'] = $userRepository->getNewCreateRoleDeviceCountByGame($params);//新创角设备 $allData['new_ip_num'] = $userRepository->getNewCreateRoleIpCountByGame($params);//新创角IP $allData['login_user_num'] = $userRepository->getLoginCountGroupByGame($params);//登录用户数 - $allData['spend_user_num'] = $spendRepository->getPayUserCountByGame($params);//充值人数 - $allData['spend_num'] = $spendRepository->getPayCountByGame($params);//充值次数 - unset($params['pay_way']); - $allData['spend_all_amount'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//充值总额 - $params['pay_way'] = ['in', '1,2,3,4,5,6']; - $allData['spend_cash'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//现金充值 - $params['pay_way'] = 0; - $allData['spend_generic'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//通用币充值 - $params['pay_way'] = -1; - $allData['spend_binding'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//绑定币充值 - $allData['spend_discount'] = '0.00'; - $allData['spend_voucher'] = '0.00'; + if ($this->canViewUserRecharge) { + $allData['spend_user_num'] = $spendRepository->getPayUserCountByGame($params);//充值人数 + $allData['spend_num'] = $spendRepository->getPayCountByGame($params);//充值次数 + unset($params['pay_way']); + $allData['spend_all_amount'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//充值总额 + $params['pay_way'] = ['in', '1,2,3,4,5,6']; + $allData['spend_cash'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//现金充值 + $params['pay_way'] = 0; + $allData['spend_generic'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//通用币充值 + $params['pay_way'] = -1; + $allData['spend_binding'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//绑定币充值 + $allData['spend_discount'] = '0.00'; + $allData['spend_voucher'] = '0.00'; + } } } diff --git a/Application/Home/View/default/Query/dailySummary.html b/Application/Home/View/default/Query/dailySummary.html index 4558669a4..5d5076ba7 100644 --- a/Application/Home/View/default/Query/dailySummary.html +++ b/Application/Home/View/default/Query/dailySummary.html @@ -158,9 +158,11 @@

新创角用户|设备

+

充值人数|充值总额

+ @@ -179,6 +181,7 @@ 新增创角IP 登录用户数 + 充值人数 充值次数 充值总额 代金劵使用 + @@ -208,6 +212,7 @@ {$allData.new_user_num}|{$allData.new_device_num} {$allData.new_ip_num} {$allData.login_user_num} + {$allData.spend_user_num} {$allData.spend_num} {$allData.spend_all_amount} @@ -216,6 +221,7 @@ {$allData.spend_binding} {$allData.spend_discount} {$allData.spend_voucher} + @@ -225,6 +231,7 @@ {$vo.new_user_num}|{$vo.new_device_num} {$vo.new_ip_num} {$vo.login_user_num} + {$vo.spend_user_num} {$vo.spend_num} {$vo.spend_all_amount} @@ -233,6 +240,7 @@ {$vo.spend_binding} {$vo.spend_discount} {$vo.spend_voucher} + @@ -323,10 +331,12 @@ dataName2 = '新创角设备'; break; case 3: + data1 = spendUserNum; data2 = spendAllAmount; dataName1 = '充值人数'; dataName2 = '充值总额'; + break; } diff --git a/Application/Home/View/default/Query/summary.html b/Application/Home/View/default/Query/summary.html index 45dd0de9a..2ffba8ee6 100644 --- a/Application/Home/View/default/Query/summary.html +++ b/Application/Home/View/default/Query/summary.html @@ -146,6 +146,7 @@ 新增创角IP 登录用户数 + 充值人数 充值次数 充值总额 代金劵使用 + @@ -177,6 +179,7 @@ {$vo.new_user_num}|{$vo.new_device_num} {$vo.new_ip_num} {$vo.login_user_num} + {$vo.spend_user_num} {$vo.spend_num} {$vo.spend_all_amount|default=0} @@ -185,6 +188,7 @@ {$vo.spend_binding|default=0} {$vo.spend_discount|default=0} {$vo.spend_voucher|default=0} + @@ -195,6 +199,7 @@ {$allData.new_user_num}|{$allData.new_device_num} {$allData.new_ip_num} {$allData.login_user_num} + {$allData.spend_user_num} {$allData.spend_num} {$allData.spend_all_amount} @@ -203,6 +208,7 @@ {$allData.spend_binding} {$allData.spend_discount} {$allData.spend_voucher} + From 4793665896bf5fa09f36f45799beef20ad51c624 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Tue, 14 Jan 2020 15:19:46 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=85=85=E5=80=BC=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E4=BC=9A=E9=95=BF=E6=9D=83=E9=99=90=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=AF=BC=E5=87=BA=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/DownloadController.class.php | 163 +++++++++++------- 1 file changed, 96 insertions(+), 67 deletions(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 09c430336..76e259dc0 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -2023,24 +2023,25 @@ class DownloadController extends BaseController { public function summaryExcelInfo($id,$map) { $xlsName = "数据汇总"; $xlsCell = array( - array('game_name','游戏名称'), - array('sdk_version','平台'), - array('role_num','创角数'), - array('user_num','创建用户'), - array('new_user_num','新创角用户'), - array('new_device_num','新创角设备'), - array('new_ip_num','新增创角ip'), - array('login_user_num','登陆用户数'), - array('spend_user_num','充值人数'), - array('spend_num','充值次数'), - array('spend_all_amount','充值总额'), - array('spend_cash','现金充值'), - array('spend_generic','通用币充值'), - array('spend_binding','绑定币充值'), - array('spend_discount','折扣币充值'), - array('spend_voucher','代金券使用'), - - ); + array('game_name','游戏名称'), + array('sdk_version','平台'), + array('role_num','创角数'), + array('user_num','创建用户'), + array('new_user_num','新创角用户'), + array('new_device_num','新创角设备'), + array('new_ip_num','新增创角ip'), + array('login_user_num','登陆用户数'), + ); + if($this->canViewUserRecharge) { + $xlsCell[] = array('spend_user_num','充值人数'); + $xlsCell[] = array('spend_num','充值次数'); + $xlsCell[] = array('spend_all_amount','充值总额'); + $xlsCell[] = array('spend_cash','现金充值'); + $xlsCell[] = array('spend_generic','通用币充值'); + $xlsCell[] = array('spend_binding','绑定币充值'); + $xlsCell[] = array('spend_discount','折扣币充值'); + $xlsCell[] = array('spend_voucher','代金券使用'); + } if(!empty($map['tab_apply.promote_id'][1])) { $params['promote_ids'] = $map['tab_apply.promote_id'][1]; } @@ -2135,20 +2136,33 @@ class DownloadController extends BaseController { $allData['new_user_num'] = $userRepository->getNewCreateRoleUserCountByGame($params);//新创角用户 $allData['new_device_num'] = $userRepository->getNewCreateRoleDeviceCountByGame($params);//新创角设备 $allData['new_ip_num'] = $userRepository->getNewCreateRoleIpCountByGame($params);//新创角IP - $allData['login_user_num'] = $userRepository->getLoginCountGroupByGame($params);//登录用户数 - $allData['spend_user_num'] = $spendRepository->getPayUserCountByGame($params);//充值人数 - $allData['spend_num'] = $spendRepository->getPayCountByGame($params);//充值次数 - unset($params['pay_way']); - $allData['spend_all_amount'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//充值总额 - $params['pay_way'] = ['in', '1,2,3,4,5,6']; - $allData['spend_cash'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//现金充值 - $params['pay_way'] = 0; - $allData['spend_generic'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//通用币充值 - $params['pay_way'] = -1; - $allData['spend_binding'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//绑定币充值 - $allData['spend_discount'] = '0.00'; - $allData['spend_voucher'] = '0.00'; - $records[] = $allData; + $allData['login_user_num'] = $userRepository->getLoginCountGroupByGame($params);//登录用户数 + + if($this->canViewUserRecharge) { + $record['spend_user_num'] = $spendUserNumList[$gameId]; + $record['spend_num'] = $spendNumList[$gameId]; + $record['spend_all_amount'] = $spendAllAmountList[$gameId]; + $record['spend_cash'] = $spendCashList[$gameId]; + $record['spend_generic'] = $spendGenericList[$gameId]; + $record['spend_binding'] = $spendBindingList[$gameId]; + $record['spend_discount'] = 0; + $record['spend_voucher'] = 0; + $allData['spend_user_num'] = $spendRepository->getPayUserCountByGame($params);//充值人数 + $allData['spend_num'] = $spendRepository->getPayCountByGame($params);//充值次数 + unset($params['pay_way']); + $allData['spend_all_amount'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//充值总额 + $params['pay_way'] = ['in', '1,2,3,4,5,6']; + $allData['spend_cash'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//现金充值 + $params['pay_way'] = 0; + $allData['spend_generic'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//通用币充值 + $params['pay_way'] = -1; + $allData['spend_binding'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//绑定币充值 + $allData['spend_discount'] = '0.00'; + $allData['spend_voucher'] = '0.00'; + + } + $records[] = $record; + $records[] = $allData; } } @@ -2887,23 +2901,26 @@ class DownloadController extends BaseController { public function dailysummaryExcelInfo($id,$map) { $xlsName = "每日概况"; $xlsCell = array( - array('day','日期'), - array('role_num','创角数'), - array('user_num','创角用户'), - array('new_user_num','新创角用户'), - array('new_device_num','新创角设备'), - array('new_ip_num','新增创角IP'), - array('login_user_num','登陆用户数'), - array('spend_user_num','充值人数'), - array('spend_num','充值次数'), - array('spend_all_amount','充值总额'), - array('spend_cash','现金充值'), - array('spend_generic','通用币充值'), - array('spend_binding','绑定币充值'), - array('spend_discount','折扣币充值'), - array('spend_voucher','代金劵使用'), - - ); + array('day','日期'), + array('role_num','创角数'), + array('user_num','创角用户'), + array('new_user_num','新创角用户'), + array('new_device_num','新创角设备'), + array('new_ip_num','新增创角IP'), + array('login_user_num','登陆用户数'), + + ); + + if ($this->canViewUserRecharge) { + $xlsCell[] = array('spend_user_num','充值人数'); + $xlsCell[] = array('spend_num','充值次数'); + $xlsCell[] = array('spend_all_amount','充值总额'); + $xlsCell[] = array('spend_cash','现金充值'); + $xlsCell[] = array('spend_generic','通用币充值'); + $xlsCell[] = array('spend_binding','绑定币充值'); + $xlsCell[] = array('spend_discount','折扣币充值'); + $xlsCell[] = array('spend_voucher','代金劵使用'); + } $nowTime = date('Y-m-d'); $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); $initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime'); @@ -2932,7 +2949,6 @@ class DownloadController extends BaseController { } $params['dayList'] = $map["dayList"]; $summaryData = []; - $records = []; if (intval($endTime - $begTime) / (24 * 3600) <= 30) { $userRepository = new UserRepository(); $spendRepository = new SpendRepository(); @@ -2957,14 +2973,16 @@ class DownloadController extends BaseController { $allData['new_device_num'] = 0; $allData['new_ip_num'] = 0; $allData['login_user_num'] = 0; - $allData['spend_user_num'] = 0; - $allData['spend_num'] = 0; - $allData['spend_all_amount'] = 0; - $allData['spend_cash'] = 0; - $allData['spend_generic'] = 0; - $allData['spend_binding'] = 0; - $allData['spend_discount'] = 0; - $allData['spend_voucher'] = 0; + if($this->canViewUserRecharge) { + $allData['spend_user_num'] = 0; + $allData['spend_num'] = 0; + $allData['spend_all_amount'] = 0; + $allData['spend_cash'] = 0; + $allData['spend_generic'] = 0; + $allData['spend_binding'] = 0; + $allData['spend_discount'] = 0; + $allData['spend_voucher'] = 0; + } foreach ($params['dayList'] as $day) { $date = date('Ymd', strtotime($day)); $records[] = [ @@ -2990,15 +3008,26 @@ class DownloadController extends BaseController { $allData['new_device_num'] += $newDeviceNumList[$day]; $allData['new_ip_num'] += $newIpNumList[$day]; $allData['login_user_num'] += $loginUserNumList[$day]; - $allData['spend_user_num'] += $spendUserNumList[$day]; - $allData['spend_num'] += $spendNumList[$day]; - $allData['spend_all_amount'] = bcadd($allData['spend_all_amount'], $spendAllAmountList[$day], 2); - $allData['spend_cash'] = bcadd($allData['spend_cash'], $spendCashList[$day], 2); - $allData['spend_generic'] = bcadd($allData['spend_generic'], $spendGenericList[$day], 2); - $allData['spend_binding'] = bcadd($allData['spend_binding'], $spendBindingList[$day], 2); - $allData['spend_discount'] = bcadd($allData['spend_discount'], 0, 2); - $allData['spend_voucher'] = bcadd($allData['spend_voucher'], 0, 2); - + if ($this->canViewUserRecharge) { + $record['spend_user_num'] = $spendUserNumList[$day]; + $record['spend_num'] = $spendNumList[$day]; + $record['spend_all_amount'] = $$spendAllAmountList[$day]; + $record['spend_cash'] = $spendCashList[$day]; + $record['spend_generic'] = $spendGenericList[$day]; + $record['spend_binding'] = $spendBindingList[$day]; + $record['spend_discount'] = 0; + $record['spend_voucher'] = 0; + $allData['spend_user_num'] += $spendUserNumList[$day]; + $allData['spend_num'] += $spendNumList[$day]; + $allData['spend_all_amount'] = bcadd($allData['spend_all_amount'], $spendAllAmountList[$day], 2); + $allData['spend_cash'] = bcadd($allData['spend_cash'], $spendCashList[$day], 2); + $allData['spend_generic'] = bcadd($allData['spend_generic'], $spendGenericList[$day], 2); + $allData['spend_binding'] = bcadd($allData['spend_binding'], $spendBindingList[$day], 2); + $allData['spend_discount'] = bcadd($allData['spend_discount'], 0, 2); + $allData['spend_voucher'] = bcadd($allData['spend_voucher'], 0, 2); + } + $records[] = $record; + } $allData['day'] = '合计'; $records[] = $allData; From 22addc182c4a410abc8d12a9d8cfd7ffea6aac71 Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Fri, 17 Jan 2020 15:19:37 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A3=80=E7=B4=A2?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/PromoteController.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index c72ec9cd4..1e8fc8058 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -1205,6 +1205,10 @@ class PromoteController extends ThinkController $map['p.account'] = array('like','%'.I('account').'%'); } + if (!is_null(I('can_view_recharge', null))) { + $map['pb.can_view_recharge'] = I('can_view_recharge'); + } + $this->m_title = '推广公会归属管理'; $this->assign('commonset', M('Kuaijieicon')->where(['url'=>'Promote/belong','status'=>1])->find()); if (isset($_REQUEST['row'])) { From 0f5e3944c0097ca9f726c42c709b16fa4c6ca4ad Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Fri, 17 Jan 2020 17:55:25 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E6=9D=83=E9=99=90=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/BaseController.class.php | 3 +++ Application/Home/View/default/Public/promote_base.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Application/Home/Controller/BaseController.class.php b/Application/Home/Controller/BaseController.class.php index 9af51d297..70d61410b 100644 --- a/Application/Home/Controller/BaseController.class.php +++ b/Application/Home/Controller/BaseController.class.php @@ -16,6 +16,9 @@ class BaseController extends HomeController 'Home/Players/playAction', 'Home/Query/userRecharges', 'Home/Query/arpu', + 'Home/Finance/index', + 'Home/Finance/settlementDtl', + 'Home/Finance/withdrawRecord', ]; protected function _initialize() diff --git a/Application/Home/View/default/Public/promote_base.html b/Application/Home/View/default/Public/promote_base.html index a9eb58304..afdd1e38e 100644 --- a/Application/Home/View/default/Public/promote_base.html +++ b/Application/Home/View/default/Public/promote_base.html @@ -75,7 +75,7 @@ - +