Merge branch 'hotfix/perm_market_visiable' of wmtx/platform into release

推广员信息显示通过权限控制
master
廖金灵 4 years ago committed by Gogs
commit 648cde1eff

@ -1585,7 +1585,7 @@ function getGameList($partner_id) {
function getAdminData ($uid) {
$adminData = M('auth_group_access')
->field('data_empower_type,data_president,show_data,show_market_admin')
->field('data_empower_type,data_president,show_data,show_market_admin,show_promote')
->join('left join sys_auth_group on sys_auth_group_access.group_id=sys_auth_group.id')
->where(array('uid'=>$uid))->find();

@ -527,13 +527,14 @@ class AuthManagerController extends AdminController{
$auth_group = M('AuthGroup')->where( array('status'=>array('egt','0'),'module'=>'admin','type'=>AuthGroupModel::TYPE_ADMIN) )
->getfield('id,id,title,rules');
// var_dump($auth_group);die();
$empower_type = M('AuthGroup')->field('data_empower_type,show_data,show_market_admin')->where(array('id'=>$_GET['group_id']))->find();
$empower_type = M('AuthGroup')->field('data_empower_type,show_data,show_market_admin,show_promote')->where(array('id'=>$_GET['group_id']))->find();
// var_dump($empower_type);die();
$this->assign('data_empower_type', $empower_type['data_empower_type']);
$this->assign('show_data', $empower_type['show_data']);
$this->assign('auth_group', $auth_group);
$this->assign('show_market_admin', $empower_type['show_market_admin']);
$this->assign('show_promote', $empower_type['show_promote']);
$this->display();
}
@ -544,6 +545,7 @@ class AuthManagerController extends AdminController{
$data_empower_type = I('data_empower_type');
$show_data = I('show_data');
$show_market_admin = I('show_market_admin');
$show_promote = I('show_promote');
$promoteData = I('promote_data');
// dump(json_decode($promoteData,true));
@ -573,6 +575,7 @@ class AuthManagerController extends AdminController{
'data_president' => $promoteData,
'show_data' => $show_data,
'show_market_admin' => $show_market_admin,
'show_promote' => $show_promote,
))) {
resetUserAuth();

@ -56,6 +56,7 @@ class ExportController extends Controller
switch ($id) {
case 1:
$showMarketAdmin = session('user_auth')['show_market_admin'];
$showPromote = session('user_auth')['show_promote'];
$headers = [
'create_time' => '创建时间',
'user_account' => '玩家账号',
@ -70,11 +71,14 @@ class ExportController extends Controller
'play_time' => '最后登录时间',
'play_ip' => '最后登录ip',
];
$xlsCell = array_values($headers);
$fields = array_keys($headers);
if ($showMarketAdmin == 0) {
unset($headers['promote_id']);
}
if ($showPromote == 0) {
unset($headers['promote_account']);
}
$xlsCell = array_values($headers);
$fields = array_keys($headers);
if (isset($_REQUEST['game_name'])) {
$map['game_name'] = ['like', trim($_REQUEST['game_name'])."%"];
unset($_REQUEST['game_name']);
@ -144,7 +148,6 @@ class ExportController extends Controller
$pages = ceil($accessNum / $perSize);
$lastId = 0;
for($i = 1; $i <= $pages; $i++) {
$xlsData = M('user_play_info', 'tab_')
@ -158,7 +161,9 @@ class ExportController extends Controller
$adminList = getMarketAdminsByPromoteIds(array_column($xlsData, 'promote_id'));
}
foreach($xlsData as $value) {
($value['promote_account']=='官方渠道'||$value['promote_account']=='自然注册')?($value['promote_account']=C('OFFICIEL_CHANNEL')):'';
if ($showPromote == 1) {
($value['promote_account']=='官方渠道'||$value['promote_account']=='自然注册')?($value['promote_account']=C('OFFICIEL_CHANNEL')):'';
}
if ($showMarketAdmin == 1) {
$value['promote_id'] = isset($adminList[$value['promote_id']]) && $adminList[$value['promote_id']]['admin'] ? $adminList[$value['promote_id']]['admin']['username'] : '无';
}
@ -1199,6 +1204,7 @@ class ExportController extends Controller
$total=$total?$total:0;
$showMarketAdmin = session('user_auth')['show_market_admin'];
$showPromote = session('user_auth')['show_promote'];
$headers = [
'pay_order_number' => '支付订单号',
@ -1227,6 +1233,9 @@ class ExportController extends Controller
if ($showMarketAdmin == 0) {
unset($headers['market_admin_id']);
}
if ($showPromote == 0) {
unset($headers['promote_account']);
}
$xlsCell = array_values($headers);
$fields = array_keys($headers);
@ -1277,8 +1286,10 @@ class ExportController extends Controller
}
$value['merchant_id'] = getMerchantName($value['merchant_id']);
checkEncryptionAuth($value['user_account'],'spend_lists');
// $value['user_account'] = encryption($value['user_account']);
($value['promote_account']=='官方渠道'||$value['promote_account']=='自然注册')?($value['promote_account']=C('OFFICIEL_CHANNEL')):'';
if ($showPromote == 1) {
($value['promote_account']=='官方渠道'||$value['promote_account']=='自然注册')?($value['promote_account']=C('OFFICIEL_CHANNEL')):'';
}
$value['extend'] = $value['extend'].'`';
$value['pay_way'] = get_pay_way($value['pay_way']);
$value['pay_status'] = get_info_status($value['pay_status'],9);
@ -4169,6 +4180,16 @@ class ExportController extends Controller
['retention_day30', '30日留存'],
];
if (session('user_auth')['show_promote'] == 0) {
foreach ($xlsCell as $key => $item) {
if ($item[0] == 'promote_name') {
unset($xlsCell[$key]);
break;
}
}
$xlsCell = array_values($xlsCell);
}
$GetData = $_GET;
unset($GetData['xlsname']);

@ -171,6 +171,7 @@ class MemberController extends ThinkController
($data[$key]['promote_account']=='官方渠道'||$data[$key]['promote_account']=='自然注册')?($data[$key]['promote_account']=C('OFFICIEL_CHANNEL')):'';
}
$showMarketAdmin = session('user_auth')['show_market_admin'];
$showPromote = session('user_auth')['show_promote'];
if(isset($_REQUEST['export'])){
$isadmin = is_administrator();
//获取等级
@ -224,6 +225,9 @@ class MemberController extends ThinkController
if ($showMarketAdmin == 0) {
unset($field['market_admin_username']);
}
if ($showPromote == 0) {
unset($field['promote_account']);
}
//操作日志
unset($_GET['export']);
addOperationLog(array(
@ -286,6 +290,7 @@ class MemberController extends ThinkController
$this->assign('repeat_count',$repeat_count);
$this->assign('no_repeat_count',$no_repeat_count);
$this->assign('showMarketAdmin', $showMarketAdmin);
$this->assign('showPromote', $showPromote);
$this->assign('user_count',$user_count);
$this->assign('now_count', $userDbRes['recharge_total']);
$page = set_pagination($user_count, $row);

@ -152,6 +152,7 @@ class RechargeSumController extends ThinkController
$this->checkListOrCountAuthRestMap($map,[]);
$this->assign('showPromote', session('user_auth')['show_promote']);
$this->assign('meta_title', "充值汇总");
$this->assign('list_data', $data);
$this->assign('total', $total);
@ -178,6 +179,15 @@ class RechargeSumController extends ThinkController
array('newAddPay', "新增玩家付费"),
array('accumulated', '本日累计'),
);
if (session('user_auth')['show_promote'] == 0) {
foreach ($expCellName as $key => $row) {
if ($row[0] == 'promote_id') {
unset($expCellName[$key]);
break;
}
}
$expCellName = array_values($expCellName);
}
$expTableData = $data;
$export->exportExcel($exptitle, $expCellName, $expTableData);
}

@ -150,6 +150,7 @@ class SpendController extends ThinkController
}
$this->assign('showMarketAdmin', session('user_auth')['show_market_admin']);
$this->assign('showPromote', session('user_auth')['show_promote']);
$this->assign('isMarketAdmin', $isMarketAdmin);
$this->assign('marketAdmins', getMarketAdmins());
$this->assign('startDate', $startDate);

@ -235,6 +235,7 @@ class StatController extends ThinkController
$this->assign('baseGames', $baseGames);
$this->checkListOrCountAuthRestMap($map,[]);
$this->assign('showPromote', session('user_auth')['show_promote']);
$this->assign('data', $data);
$this->assign('order_type', $orderType);
$this->assign('order_column', $orderColumn);
@ -843,6 +844,7 @@ AND UNIX_TIMESTAMP(
$this->checkListOrCountAuthRestMap($map,[]);
$this->meta_title = 'ARPU统计';
$this->assign('showPromote', session('user_auth')['show_promote']);
$this->assign('baseGames', $baseGames);
$this->assign('records', $rows);
$this->assign('order', $order);

@ -750,6 +750,7 @@ class UserController extends AdminController
$value['market_admin_username'] = isset($adminList[$value['promote_id']]) && $adminList[$value['promote_id']]['admin'] ? $adminList[$value['promote_id']]['admin']['username'] : '无';
}
$this->assign('showPromote', session('user_auth')['show_promote']);
$this->assign('showMarketAdmin', session('user_auth')['show_market_admin']);
$this->assign('list', $list);
$this->meta_title = '角色数据';

@ -83,6 +83,7 @@ class MemberModel extends Model {
'data_president'=>$adminData['data_president'],
'show_data'=>$adminData['show_data'],
'show_market_admin'=>$adminData['show_market_admin'],
'show_promote'=>$adminData['show_promote'],
);
//登录有效时间改为1小时
$expireTime = 3600;

@ -96,6 +96,23 @@
</td>
</tr>
<tr>
<td class="l noticeinfo" style="padding-left: 15px;">是否显示推广员:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label>
<input type="radio" class="inp_radio" value="1" name="show_promote"
<if condition="$show_promote==1"> checked </if>> 是
</label>
<label>
<input type="radio" class="inp_radio" value="0" name="show_promote"
<if condition="$show_promote==0"> checked </if>> 否
</label>
</span>
<span class="notice-text"></span>
</td>
</tr>
</tbody>
</table>
</div>

@ -146,6 +146,7 @@
<option value="1" <?php echo I('is_repeat') && I('is_repeat') == 1 ? "selected" : ''?>>是</option>
</select>
</div>
<?php if($showPromote == 1):?>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_level" style="color:#444" class="select_gallery" id="promote_level">
<option value="">请选择推广员等级</option>
@ -163,6 +164,7 @@
<option value="UC" <?php if ($_POST['promote_id'] == 'UC'):?>selected<?php endif;?>>UC用户</option>
</select>
</div>
<?php endif;?>
<?php if(!$isMarketAdmin && $showMarketAdmin == 1):?>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="market_admin_id" style="color:#444" class="select_gallery" id="market_admin_id">
@ -214,7 +216,9 @@
<else/>
<th>玩家账号</th>
</if>
<?php if($showPromote == 1):?>
<th>所属推广员</th>
<?php endif;?>
<?php if($showMarketAdmin == 1):?>
<th>所属市场专员</th>
<?php endif;?>
@ -286,6 +290,7 @@
<!--{$data.account}-->
</td>
</if>
<?php if($showPromote == 1):?>
<td >
<if condition="$data['promote_account'] eq '自然注册'">
{:C('OFFICIEL_CHANNEL')}
@ -300,6 +305,7 @@
</empty>
</if>
</td>
<?php endif;?>
<?php if($showMarketAdmin == 1):?>
<td >{$data.market_admin_username}</td>
<?php endif;?>

@ -85,6 +85,7 @@
<option value="">区服名称</option>
</select>
</div>
<?php if($showPromote == 1):?>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_level" style="color:#444" class="select_gallery" id="promote_level">
<option value="">请选择推广员等级</option>
@ -100,6 +101,7 @@
<option value="">请选择推广员</option>
</select>
</div>
<?php endif;?>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('RechargeSum/summation',array('row'=>I('row')))}">搜索</a>
</div>
@ -114,7 +116,9 @@
<tr>
<th>日期</th>
<?php if($showPromote == 1):?>
<th>渠道来源</th>
<?php endif;?>
<th>游戏名称</th>
<th>新增人数</th>
<th>活跃人数</th>
@ -133,7 +137,9 @@
<tr>
<td>{$data.date}</td>
<?php if($showPromote == 1):?>
<td>{$data.promote_id}</td>
<?php endif;?>
<td>{$data.game_id}</td>
<td>{$data.registerNum}</td>
<td>{$data.livenNum}</td>

@ -113,6 +113,8 @@
</select>
</div>
<br>
<?php if($showPromote == 1):?>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_level" style="color:#444" class="select_gallery" id="promote_level">
<option value="">请选择推广员等级</option>
@ -128,6 +130,8 @@
<option value="">请选择推广员</option>
</select>
</div>
<?php endif;?>
<?php if(!$isMarketAdmin && $showMarketAdmin == 1):?>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="market_admin_id" style="color:#444" class="select_gallery" id="market_admin_id">
@ -182,7 +186,9 @@
<th>支付时间</th>
<th>玩家账号</th>
<th>游戏名称</th>
<?php if($showPromote == 1):?>
<th>所属推广员</th>
<?php endif;?>
<?php if($showMarketAdmin == 1):?>
<th>所属市场专员</th>
<?php endif;?>
@ -240,6 +246,7 @@
</if>
<gt name="data.small_id" value="0"><neq name="data.small_id" value="$data.user_id">{$data.small_account}</neq></gt></td>
<td>{$data.game_name}</td>
<?php if($showPromote == 1):?>
<td>
<eq name="data.promote_id" value="-1">C('OFFICIEL_CHANNEL')<else/>
<!-- <if condition="$is_admin eq true ">
@ -251,6 +258,7 @@
<!-- {:get_promote_account($data['promote_id'])}-->
</eq>
</td>
<?php endif;?>
<?php if($showMarketAdmin == 1):?>
<td >{$data.market_admin_username}</td>
<?php endif;?>

@ -117,6 +117,7 @@
<option value="ios" <?php if(I('device_type', '') == 'ios'):?>selected<?php endif;?>>IOS</option>
</select>
</div>
<?php if($showPromote == 1):?>
<div class="input-list input-list-promote search_label_rehab">
<select id="promote_id" name="promote_id" class="select_gallery" >
<option value="">推广员账号</option>
@ -125,6 +126,7 @@
</volist>
</select>
</div>
<?php endif;?>
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('stat/userarpu','model='.$model['name'].'&row='.I('row'),false)}">搜索</a>

@ -59,6 +59,7 @@
<option value="ios" <?php if(I('device_type', '') == 'ios'):?>selected<?php endif;?>>IOS</option>
</select>
</div>
<?php if($showPromote == 1):?>
<div class="input-list input-list-promote search_label_rehab">
<select id="promote_id" name="promote_id" class="select_gallery" >
<option value="">推广员账号</option>
@ -67,6 +68,7 @@
</volist>
</select>
</div>
<?php endif;?>
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('stat/userretention','model='.$model['name'].'&row='.I('row'),false)}">搜索</a>
@ -84,7 +86,9 @@
<tr>
<th ><a class="paixu" data-order='date'>日期 <?=$order_column=='date'?($order_type=='desc'?'▼':'▲'):$noOrder?></a></th>
<th>游戏名称</th>
<?php if($showPromote == 1):?>
<th>渠道名称</th>
<?php endif;?>
<th ><a class="paixu" data-order='register_count'>新增玩家 <?=$order_column=='register_count'?($order_type=='desc'?'▼':'▲'):$noOrder?></a></th>
<th ><a class="paixu" data-order='retention_day1'>1日留存 <?=$order_column=='retention_day1'?($order_type=='desc'?'▼':'▲'):$noOrder?></a></th>
@ -117,7 +121,9 @@
<tr>
<td>{$vo.date}</td>
<td>{$vo.game_name}</td>
<?php if($showPromote == 1):?>
<td>{$vo.promote_name}</td>
<?php endif;?>
<td>{$vo.register_count}</td>
<?php if ($vo['register_count']>0):?>
<td>{$vo['retention_day1']}%</td>

@ -82,6 +82,7 @@
<option value="">区服名称</option>
</select>
</div>
<?php if($showPromote == 1):?>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_level" style="color:#444" class="select_gallery" id="promote_level">
<option value="">请选择推广员等级</option>
@ -100,6 +101,7 @@
<option value="UC" <?php if ($_POST['promote_id'] == 'UC'):?>selected<?php endif;?>>UC用户</option>
</select>
</div>
<?php endif;?>
<div class="input-list">
<input type="text" readonly id="time_start" name="time_start" class="" value="{:I('time_start')}" placeholder="创角开始时间" />
&nbsp;-&nbsp;
@ -136,7 +138,9 @@
<th class="">角色ID</th>
<th class="">角色名</th>
<th class="">游戏等级</th>
<?php if($showPromote == 1):?>
<th class="">所属推广员</th>
<?php endif;?>
<?php if($showMarketAdmin == 1):?>
<th>所属市场专员</th>
<?php endif;?>
@ -167,6 +171,7 @@
<td><span class="badge"> {$data['role_id']}</span></td>
<td><notempty name="rolename">{$rolename}<else /></notempty></td>
<td>{$data.role_level}</td>
<?php if($showPromote == 1):?>
<td>
<if condition="$show_data_power eq true ">
{$data.promote_account}
@ -174,6 +179,7 @@
{$data.promote_account|encryptStr}
</if>
</td>
<?php endif;?>
<?php if($showMarketAdmin == 1):?>
<td >{$data.market_admin_username}</td>
<?php endif;?>

Loading…
Cancel
Save