数据权限功能提交

master
zhengyongxing 5 years ago
parent 46538019d4
commit 6f584f8323

@ -455,6 +455,11 @@ class AuthManagerController extends AdminController{
$mid = I('id'); $mid = I('id');
$gid = I('group_id'); $gid = I('group_id');
$data_empower_type = I('data_empower_type'); $data_empower_type = I('data_empower_type');
$promoteData = I('promote_data');
// dump(json_decode($promoteData,true));
// var_dump($promoteData);die();
// str_replace("'valuie'","'id'");
if( empty($gid)||empty($data_empower_type) ){ if( empty($gid)||empty($data_empower_type) ){
$this->error('参数有误'); $this->error('参数有误');
@ -468,7 +473,13 @@ class AuthManagerController extends AdminController{
$this->error($AuthGroup->error); $this->error($AuthGroup->error);
} }
if ($AuthGroup->where("id = {$gid}")->save(array('data_empower_type'=>$data_empower_type))) { if ($data_empower_type == 2) {
$promoteData = implode(',',array_column(json_decode($promoteData,true),'value'));
} else {
$promoteData = '';
}
if ($AuthGroup->where("id = {$gid}")->save(array('data_empower_type'=>$data_empower_type,'data_president'=>$promoteData))) {
$this->success('操作成功',U('AuthManager/index')); $this->success('操作成功',U('AuthManager/index'));
} else { } else {
$this->error('操作失败'); $this->error('操作失败');
@ -478,8 +489,11 @@ class AuthManagerController extends AdminController{
function getRootPromote() { function getRootPromote() {
$promoteData = M('promote','tab_')->field('id as value,account as title')->where(array('level'=>1,'chain'=>'/'))->select(); $promoteData = M('promote','tab_')->field('id as value,account as title')->where(array('level'=>1,'chain'=>'/'))->select();
$data_president = M('AuthGroup')->field('data_president')->where(array('id'=>$_REQUEST['group_id']))->find();
$returnData = array('data_president'=>$data_president['data_president'],'list'=>$promoteData);
$this->ajaxReturn(json_encode($promoteData)); $this->ajaxReturn(json_encode($returnData));
} }
} }

Loading…
Cancel
Save