管理后台新开发功能修改

master
zhengyongxing 5 years ago
parent b2d1c27054
commit 46538019d4

@ -1541,4 +1541,17 @@ function getGameList($partner_id) {
return $data;
}
function getAdminData ($uid) {
$adminData = M('auth_group_access')
->field('data_empower_type,data_president')
->join('left join sys_auth_group on sys_auth_group_access.group_id=sys_auth_group.id')
->where(array('uid'=>$uid))->find();
$promoteData = M('promote','tab_')->field('id')->where(array('admin_id'=>$uid))->select();
$promoteData = implode(',',array_column($promoteData,'id'));
$adminData['data_president'] = $adminData['data_president'].','.$promoteData;
return $adminData;
}
?>

@ -438,4 +438,48 @@ class AuthManagerController extends AdminController{
}
}
public function dataempower() {
$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')->where(array('id'=>$_GET['group_id']))->find();
// var_dump($empower_type);die();
$this->assign('data_empower_type', $empower_type['data_empower_type']);
$this->assign('auth_group', $auth_group);
$this->display();
}
public function dataEmpowerSave() {
$mid = I('id');
$gid = I('group_id');
$data_empower_type = I('data_empower_type');
if( empty($gid)||empty($data_empower_type) ){
$this->error('参数有误');
}
$AuthGroup = D('AuthGroup');
if( !$AuthGroup->find($gid)){
$this->error('用户组不存在');
}
if( $mid && !$AuthGroup->checkModelId($mid)){
$this->error($AuthGroup->error);
}
if ($AuthGroup->where("id = {$gid}")->save(array('data_empower_type'=>$data_empower_type))) {
$this->success('操作成功',U('AuthManager/index'));
} else {
$this->error('操作失败');
}
}
function getRootPromote() {
$promoteData = M('promote','tab_')->field('id as value,account as title')->where(array('level'=>1,'chain'=>'/'))->select();
$this->ajaxReturn(json_encode($promoteData));
}
}

@ -200,7 +200,7 @@ class PromoteController extends ThinkController
if (C('PROMOTE_AUTO_AUDIT') == 1) {
$status = 1;
}
$data = array('account'=>$account,'password'=>$password,'second_pwd'=>$second_pwd,'real_name'=>$real_name,'email'=>$email,'mobile_phone'=>$mobile_phone,'bank_name'=>$bank_name,'bank_card'=>$bank_card,'admin_id'=>$admin,'status'=>$status,'ba_id'=>$ba_id);
$data = array('account'=>$account,'password'=>$password,'second_pwd'=>$second_pwd,'real_name'=>$real_name,'email'=>$email,'mobile_phone'=>$mobile_phone,'bank_name'=>$bank_name,'bank_card'=>$bank_card,'admin_id'=>session('user_auth')['uid'],'status'=>$status,'ba_id'=>$ba_id);
if (preg_match('/^[a-zA-Z0-9]{6,15}$/', $account)==false) {
$this->error('账号只能是6-15位字母或数字');

File diff suppressed because one or more lines are too long

@ -71,11 +71,15 @@ class MemberModel extends Model {
);
$this->save($data);
$adminData = getAdminData($user['uid']);
/* 记录登录SESSION和COOKIES */
$auth = array(
'uid' => $user['uid'],
'username' => $user['nickname'],
'last_login_time' => $user['last_login_time'],
'data_empower_type'=>$adminData['data_empower_type'],
'data_president'=>$adminData['data_president']
);
session('user_auth', $auth);
session('user_auth_sign', data_auth_sign($auth));

@ -14,6 +14,7 @@
<ul>
<li><a href="{:U('AuthManager/access',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">访问授权</a></li>
<li class="current"><a href="javascript:;">分类授权</a></li>
<li><a href="{:U('AuthManager/dataempower',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">数据授权</a></li>
<li><a href="{:U('AuthManager/user',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">成员授权</a></li>
<li class="fr tab_select">
<select name="group">

@ -46,6 +46,7 @@
<td><a href="{:U('AuthManager/access?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >访问授权</a>
<a href="{:U('AuthManager/category?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >分类授权</a>
<a href="{:U('AuthManager/user?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >成员授权</a>
<a href="{:U('AuthManager/dataempower?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >数据授权</a>
</td>
<td>
<eq name="vo.status" value="1"><span class="enabled_status">{:get_status_title($vo['status'])}</span>

@ -14,6 +14,7 @@
<ul>
<li class="current"><a href="javascript:;">访问授权</a></li>
<li><a href="{:U('AuthManager/category',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">分类授权</a></li>
<li><a href="{:U('AuthManager/dataempower',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">数据授权</a></li>
<li><a href="{:U('AuthManager/user',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">成员授权</a></li>
<li class="fr tab_select">
<select name="group">

@ -14,7 +14,8 @@
<ul>
<li><a href="{:U('AuthManager/access',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">访问授权</a></li>
<li><a href="{:U('AuthManager/category',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">分类授权</a></li>
<li class="current"><a href="javascript:;">成员授权</a></li>
<li><a href="{:U('AuthManager/dataempower',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">数据授权</a></li>
<li class="current"><a href="javascript:;">成员授权</a></li>
<li class="fr tab_select">
<select name="group">
<volist name="auth_group" id="vo">

@ -133,7 +133,7 @@
</td>
<td>{$data.pay_price}</td>
<td></td>
<td>{$data.pay_way}</td>
</tr>
</volist>

Loading…
Cancel
Save