|
|
|
@ -205,12 +205,14 @@ class AuthManagerController extends AdminController{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(isset($_POST['rules'])){
|
|
|
|
|
$isrules = true;
|
|
|
|
|
if(!empty($ruleiddata)){
|
|
|
|
|
$_POST['rules'] = array_merge($_POST['rules'],$ruleiddata);
|
|
|
|
|
}
|
|
|
|
|
sort($_POST['rules']);
|
|
|
|
|
$_POST['rules'] = implode( ',' , array_unique($_POST['rules']));
|
|
|
|
|
}else{
|
|
|
|
|
$isrules = false;
|
|
|
|
|
$_POST['rules'] = '';
|
|
|
|
|
}
|
|
|
|
|
$_POST['module'] = 'admin';
|
|
|
|
@ -220,7 +222,7 @@ class AuthManagerController extends AdminController{
|
|
|
|
|
if ( $data ) {
|
|
|
|
|
if ( empty($data['id']) ) {
|
|
|
|
|
\Think\Log::actionLog('AuthManager/createGroup','authGroup',1);
|
|
|
|
|
$r = SM("auth_group","sys_")->add($data);
|
|
|
|
|
$r = $AuthGroup->syncAdd($data);
|
|
|
|
|
addOperationLog(array(
|
|
|
|
|
"op_type"=>0,
|
|
|
|
|
"key"=> $_POST['title'],
|
|
|
|
@ -228,8 +230,12 @@ class AuthManagerController extends AdminController{
|
|
|
|
|
));
|
|
|
|
|
}else{
|
|
|
|
|
\Think\Log::actionLog('AuthManager/editGroup','authGroup',1);
|
|
|
|
|
$r = SM("auth_group","sys_")->save($data);
|
|
|
|
|
// dd($r);
|
|
|
|
|
if($isrules){
|
|
|
|
|
$r = SM("auth_group","sys_")->save($data);
|
|
|
|
|
}else{
|
|
|
|
|
$r = $AuthGroup->where("id={$data['id']}")->syncSave($data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//操作日志,不传title表示是访问授权
|
|
|
|
|
$oparr = array(
|
|
|
|
|
"op_type"=>1,
|
|
|
|
@ -308,7 +314,8 @@ class AuthManagerController extends AdminController{
|
|
|
|
|
$savedata = [
|
|
|
|
|
"status"=>$status
|
|
|
|
|
];
|
|
|
|
|
$res = M("AuthGroup")->where("id in ({$ids})")->save($savedata);
|
|
|
|
|
// dd($savedata);
|
|
|
|
|
$res = D("AuthGroup")->where("id in ({$ids})")->syncSave($savedata);
|
|
|
|
|
if($res !==false ){
|
|
|
|
|
$this->success($msg['success'],$msg['url'],$msg['ajax']);
|
|
|
|
|
}else{
|
|
|
|
@ -571,7 +578,7 @@ class AuthManagerController extends AdminController{
|
|
|
|
|
$promoteData = '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($AuthGroup->where("id = {$gid}")->save(array(
|
|
|
|
|
if ($AuthGroup->where("id = {$gid}")->syncSave(array(
|
|
|
|
|
'data_empower_type' => $data_empower_type,
|
|
|
|
|
'data_president' => $promoteData,
|
|
|
|
|
'show_data' => $show_data,
|
|
|
|
@ -620,7 +627,7 @@ class AuthManagerController extends AdminController{
|
|
|
|
|
|
|
|
|
|
$data = json_encode($data);
|
|
|
|
|
|
|
|
|
|
$AuthGroup->where(['id'=>$gid])->save(['market_percentage'=>$data]);
|
|
|
|
|
$AuthGroup->where(['id'=>$gid])->syncSave(['market_percentage'=>$data]);
|
|
|
|
|
|
|
|
|
|
$this->success("编辑成功",U("index"));
|
|
|
|
|
|
|
|
|
|