修改权限

master
ELF 4 years ago
parent 480d899152
commit dec6c4b222

@ -819,7 +819,7 @@ AND UNIX_TIMESTAMP(
'date' => '日期',
'new_user' => '新增玩家',
'login_user' => '活跃玩家',
'pay_account' => '充值金额',
'pay_amount' => '充值金额',
'pay_user' => '付费玩家',
'pay_rate' => '付费率',
'arpu' => 'ARPU',

@ -14,7 +14,7 @@ class PromoteGradeController extends BaseController
parent::_initialize();
$loginPromote = $this->getLoginPromote();
if((C('APP_ENV') == 'dev' || $loginPromote['company_id'] == 334) && $loginPromote['level'] <= 2) {
if(C('APP_ENV') == 'dev' || $loginPromote['company_id'] == 334) {
} else {
return $this->error('您没有权限');
@ -88,6 +88,8 @@ class PromoteGradeController extends BaseController
public function settings()
{
$this->checkSettingPermission();
$loginPromote = $this->getLoginPromote();
$items = M('promote_grade_setting', 'tab_')->where(['company_id' => $loginPromote['company_id']])->select();
@ -135,8 +137,8 @@ class PromoteGradeController extends BaseController
public function setting()
{
$this->checkSettingPermission();
$id = I('id', 0);
$setting = null;
if ($id > 0) {
$setting = M('promote_grade_setting', 'tab_')->where(['id' => $id])->find();
@ -152,6 +154,7 @@ class PromoteGradeController extends BaseController
public function delete()
{
$this->checkSettingPermission();
$id = I('id', 0);
if ($id == 0) {
return $this->error('记录不存在');
@ -167,6 +170,8 @@ class PromoteGradeController extends BaseController
public function saveSetting()
{
$this->checkSettingPermission();
$params = I('post.');
$loginPromote = $this->getLoginPromote();
$promoteGradeService = new PromoteGradeService();
@ -177,4 +182,12 @@ class PromoteGradeController extends BaseController
return $this->error($e->getMessage());
}
}
public function checkSettingPermission()
{
$loginPromote = $this->getLoginPromote();
if ($loginPromote['level'] > 2) {
return $this->error('您没有权限');
}
}
}

@ -119,10 +119,12 @@
<a href="{:U('TestingResource/batches')}" class="<if condition='CONTROLLER_NAME eq TestingResource and ACTION_NAME eq batches '>active</if> ">测试资源申请记录</a>
</div>
<?php endif;?>
<?php if((C('APP_ENV') == 'dev' || $loginer['company_id'] == 334) && $loginer['level'] <= 2):?>
<?php if(C('APP_ENV') == 'dev' || $loginer['company_id'] == 334):?>
<div class="subNav jssubNav"><i class="prev_icon icon_fenbao"></i><span>评级管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<?php if($loginer['level'] <= 2):?>
<a href="{:U('PromoteGrade/settings')}" class="<if condition='CONTROLLER_NAME eq PromoteGrade and (ACTION_NAME eq settings or ACTION_NAME eq setting) '>active</if> ">评级设定</a>
<?php endif;?>
<a href="{:U('PromoteGrade/index')}" class="<if condition='CONTROLLER_NAME eq PromoteGrade and ACTION_NAME eq index '>active</if> ">团队评级</a>
</div>
<?php endif;?>

Loading…
Cancel
Save