From 6f584f8323c493b5e36311d6b0c7c67e2022c913 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Fri, 13 Dec 2019 11:40:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/AuthManagerController.class.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/AuthManagerController.class.php b/Application/Admin/Controller/AuthManagerController.class.php index 878273c98..44c5293c7 100644 --- a/Application/Admin/Controller/AuthManagerController.class.php +++ b/Application/Admin/Controller/AuthManagerController.class.php @@ -455,6 +455,11 @@ class AuthManagerController extends AdminController{ $mid = I('id'); $gid = I('group_id'); $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) ){ $this->error('参数有误'); @@ -468,7 +473,13 @@ class AuthManagerController extends AdminController{ $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')); } else { $this->error('操作失败'); @@ -478,8 +489,11 @@ class AuthManagerController extends AdminController{ function getRootPromote() { $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)); } }