优化权限展示

master
chenzhi 3 years ago
parent 5310eaa507
commit a2b9d3aef1

@ -1621,7 +1621,7 @@ function getGameList($partner_id) {
function getAdminData ($uid) {
$adminData = SM('auth_group_access','sys_')
->field('data_empower_type,data_president,show_data,show_market_admin,show_promote,allow_over_week')
->field('data_empower_type,data_president,show_data,show_market_admin,show_promote,allow_over_week,show_merchant')
->join('left join sys_auth_group on sys_auth_group_access.group_id=sys_auth_group.id')
->where(array('uid'=>$uid))->find();
@ -3286,7 +3286,7 @@ function getCpCompanySelect($type = 1){
* @return mixed
*/
function getMerchantList($type = 1){
if(A('Market','Event')->getConfig('isMarket')) return [];
if(session('user_auth')['show_merchant'] == 0) return [];
$data = M("payment_merchant","tab_")->field("id,name,ways")->select();
return $data;
@ -3299,7 +3299,7 @@ function getMerchantList($type = 1){
* @return mixed
*/
function getMerchantName($id = 1){
if(A('Market','Event')->getConfig('isMarket')) return '--';
if(session('user_auth')['show_merchant'] == 0) return '--';
$data = M("payment_merchant","tab_")->field("name")->where(['id'=>$id])->find();
return $data['name']?$data['name']:'无';

@ -894,8 +894,8 @@ class FinancePromoteController extends AdminController
$marketAdmins = getAdminUsernameList($marketAdminIds);
$adminDepartments = getAdminDepartmentList($marketAdminIds);
}
$isMarketAdmin = A('Market','Event')->getConfig('isMarket');
if(!$isMarketAdmin){
$show_merchant = (session('user_auth')['show_merchant'] == 1) ? true : false;
if($show_merchant){
$merchant_data = M("payment_merchant","tab_")
->field("id,name")
->where("1=1")
@ -908,7 +908,7 @@ class FinancePromoteController extends AdminController
}
foreach($data as $key => $value) {
$data[$key]['merchant_name'] = $isMarketAdmin ? "--" : $handle_merchant[$value['merchant_id']];
$data[$key]['merchant_name'] = $show_merchant ? $handle_merchant[$value['merchant_id']] : "--";
$data[$key]['pay_way'] = getPayType($value['pay_way']);
$data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']);
$data[$key]['sdk_version'] =getGameTypeName($data[$key]['sdk_version']);

@ -117,6 +117,7 @@ class PublicController extends \Think\Controller
'data_empower_type'=>$adminData['data_empower_type'],
'data_president'=>$adminData['data_president'],
'show_data'=>$adminData['show_data'],
'show_merchant'=>$adminData['show_merchant']
);
//登录有效时间改为6小时
$expireTime = 3600;

@ -83,6 +83,7 @@ class MemberModel extends Model {
'show_market_admin'=>$adminData['show_market_admin'],
'allow_over_week' => $adminData['allow_over_week'],
'show_promote'=>$adminData['show_promote'],
'show_merchant'=>$adminData['show_merchant']
);
session('user_group_id',$groupId);
session('user_auth', $auth);

Loading…
Cancel
Save