充值信息根据会长权限显示

master
ELF 5 years ago
parent 43a335bc28
commit f0acbc1c24

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

@ -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'=>'无权限操作'));

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

@ -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();

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

@ -4,6 +4,7 @@
</block>
<block name="body">
<div class="page-overview promote-index-overview index-overview clearfix poll">
<?php if($canViewUserRecharge):?>
<ul>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi1.png"/></span></div> <div class="text text2"><p>推广总用户</p><span>{$data.count}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi2.png"/></span></div> <div class="text text1"><p>推广总充值</p><span>¥{$spendData.sum_count}</span></div> </li>
@ -16,6 +17,13 @@
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div> <div class="text text3"><p>今日注册用户</p><span>{$data.today}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi5.png"/></span></div> <div class="text text5"><p>今日充值金额</p><span>¥{$spendData.sum_today}</span></div> </li>
</ul>
<?php else:?>
<ul>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi1.png"/></span></div> <div class="text text2"><p>推广总用户</p><span>{$data.count}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi1.png"/></span></div> <div class="text text2"><p>昨日注册用户</p><span>{$data.yesterday}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div> <div class="text text3"><p>今日注册用户</p><span>{$data.today}</span></div> </li>
</ul>
<?php endif;?>
</div>
<div class="index-tab-list">
<ul>

@ -52,20 +52,25 @@
</div>
<?php endif;?>
<?php
$isOpenQuery = true;
?>
$isOpenQuery = true;
?>
<?php if($isOpenQuery):?>
<div class="subNav jssubNav"><i class="prev_icon icon_shujvi"></i><span>数据管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<a href="{:U('Query/dailySummary')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq dailySummary '>active</if> ">每日概况</a>
<a href="{:U('Query/summary')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq summary '>active</if> ">数据汇总</a>
<?php if($canViewUserRecharge):?>
<a href="{:U('Query/recharge')}" class="<if condition='CONTROLLER_NAME eq Query and (ACTION_NAME eq recharge or ACTION_NAME eq viewSpendDetailed) '>active</if> ">订单查询</a>
<?php endif;?>
<a href="{:U('Query/register')}" class="<if condition='CONTROLLER_NAME eq Query and (ACTION_NAME eq register or ACTION_NAME eq viewRole) '>active</if> ">注册明细</a>
<?php if($canViewUserRecharge):?>
<a href="{:U('Query/arpu')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq arpu '>active</if> ">ARPU统计</a>
<?php endif;?>
<!-- <a href="{:U('Query/retention_analysis')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq retention_analysis '>active</if> ">留存统计</a> -->
<a href="{:U('Query/userRoles')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq userRoles '>active</if> ">角色查询</a>
<?php if($canViewUserRecharge):?>
<a href="{:U('Query/userRecharges')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq userRecharges '>active</if> ">充值玩家</a>
<?php endif;?>
<a href="{:U('Query/achievement')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq achievement '>active</if> ">团队/推广员业绩</a>
</div>
@ -128,10 +133,12 @@
<?php endif;?>
</div>
<?php if($canViewUserRecharge):?>
<div class="subNav jssubNav"><i class="prev_icon icon_fuli"></i><span>玩家管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<a href="{:U('Players/playAction')}" class="<if condition='CONTROLLER_NAME eq Players and (ACTION_NAME eq playAction)'>active</if> ">行为日志</a>
</div>
<?php endif;?>
</div>
</div>

@ -83,12 +83,14 @@
<!-- <th>新创角设备</th> -->
<th>新创角IP</th>
<th>登录用户数</th>
<?php if($canViewUserRecharge):?>
<th>充值人数</th>
<th>充值次数</th>
<th>充值总额</th>
<th>现金充值</th>
<th>通用币充值</th>
<th>绑定币充值</th>
<?php endif;?>
<?php if($parent['level'] < 4):?>
<th>操作</th>
<?php endif;?>
@ -109,12 +111,14 @@
<!-- <td>{$record.new_create_role_device_count}</td> -->
<td>{$record.new_create_role_ip_count}</td>
<td>{$record.login_user_count}</td>
<?php if($canViewUserRecharge):?>
<td>{$record.recharge_user_count}</td>
<td>{$record.recharge_count}</td>
<td>{$record.recharge_amount}</td>
<td>{$record.recharge_by_cash}</td>
<td>{$record.recharge_by_coin}</td>
<td>{$record.recharge_by_ban_coin}</td>
<?php endif;?>
<?php if($parent['level'] < 4):?>
<td>
<?php if($record['current_display'] == '' && $record['level'] < 4):?>

@ -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 '是否显示充值数据';

Loading…
Cancel
Save