|
@@ -63,7 +63,6 @@ class Menu extends Base
|
|
|
$value['child']=$temp;
|
|
|
$list[]=$value;
|
|
|
}
|
|
|
- write_log("所有菜单查询",$this->userinfo,"菜单模块","菜单列表","后台管理员");
|
|
|
return app_show(0,"获取成功",$list);
|
|
|
}
|
|
|
|
|
@@ -82,7 +81,6 @@ class Menu extends Base
|
|
|
$condition = ['menuid'=>$pageid,];
|
|
|
$data=Db::name('action')->alias("a")->Join("fc_action_list l","a.action_code=l.action_code","left")->field
|
|
|
("a.*,action_name")->where($condition)->select();
|
|
|
- write_log("菜单{$menu['menu_name']}功能查询",$this->userinfo,"菜单模块","菜单功能","后台管理员");
|
|
|
return app_show(0,"获取成功",$data);
|
|
|
}
|
|
|
|
|
@@ -126,7 +124,8 @@ class Menu extends Base
|
|
|
$data = ['action_code'=>$code,'status'=>$status,"updatetime"=>date("Y-m-d H:i:s")];
|
|
|
$result=Db::name("action")->where(["id"=>$actid])->update($data);
|
|
|
if($result){
|
|
|
- write_log("菜单{$menu['name']}功能{$action_info['action_name']}编辑成功",$this->userinfo,"菜单模块","菜单功能编辑","后台管理员");
|
|
|
+ write_log("菜单{$menu['menu_name']}功能{$action_info['action_name']}编辑成功",$this->userinfo,"orderaction",
|
|
|
+ "edit","0");
|
|
|
return app_show(0,"更新成功");
|
|
|
}else{
|
|
|
return error_show(1004,"更新失败");
|
|
@@ -149,7 +148,7 @@ class Menu extends Base
|
|
|
if(empty($action)){
|
|
|
return error_show(1001,'页面功能未找到数据');
|
|
|
}
|
|
|
- $action_info = Db::name("action_list")->where(["action_code"=>$action['code']])->find();
|
|
|
+ $action_info = Db::name("action_list")->where(["action_code"=>$action['action_code']])->find();
|
|
|
if(empty($action_info)){
|
|
|
return error_show(1003,'功能数据未找到');
|
|
|
}
|
|
@@ -169,7 +168,8 @@ class Menu extends Base
|
|
|
$result=Db::name("action")->where(["id"=>$actid])->update($data);
|
|
|
$msg= $status==1?"启用":"禁用";
|
|
|
if($result){
|
|
|
- write_log("菜单{$menu['name']}功能{$action_info['action_name']}{$msg}成功",$this->userinfo,"菜单模块","菜单功能状态","后台管理员");
|
|
|
+ write_log("菜单{$menu['menu_name']}功能{$action_info['action_name']}{$msg}成功",$this->userinfo,
|
|
|
+ "orderaction","status","0");
|
|
|
return app_show(0,"更新成功");
|
|
|
}else{
|
|
|
return error_show(1004,"更新失败");
|
|
@@ -188,7 +188,7 @@ class Menu extends Base
|
|
|
if(empty($action)){
|
|
|
return error_show(1001,'页面功能未找到数据');
|
|
|
}
|
|
|
- $action_info = Db::name("action_list")->where(["action_code"=>$action['code']])->find();
|
|
|
+ $action_info = Db::name("action_list")->where(["action_code"=>$action['action_code']])->find();
|
|
|
if(empty($action_info)){
|
|
|
return error_show(1003,'功能数据未找到');
|
|
|
}
|
|
@@ -204,7 +204,8 @@ class Menu extends Base
|
|
|
}
|
|
|
$result=Db::name("action")->where(["id"=>$actid])->delete();
|
|
|
if($result){
|
|
|
- write_log("菜单{$menu['name']}功能{$action_info['action_name']}删除成功",$this->userinfo,"菜单模块","菜单功能删除","后台管理员");
|
|
|
+ write_log("菜单{$menu['menu_name']}功能{$action_info['action_name']}删除成功",$this->userinfo,"orderaction",
|
|
|
+ "del","0");
|
|
|
return app_show(0,"更新成功");
|
|
|
}else{
|
|
|
return error_show(1004,"更新失败");
|
|
@@ -248,7 +249,8 @@ class Menu extends Base
|
|
|
return error_show(1003,'此功能已存在');
|
|
|
}else{
|
|
|
Db::name("action")->insert($data);
|
|
|
- write_log("菜单{$menu['name']}功能{$action_info['action_name']}新建成功",$this->userinfo,"菜单模块","菜单功能新建","后台管理员");
|
|
|
+ write_log("菜单{$menu['menu_name']}功能{$action_info['action_name']}新建成功",$this->userinfo,"orderaction",
|
|
|
+ "add","0");
|
|
|
return app_show(0,"添加成功");
|
|
|
}
|
|
|
}catch (\Exception $e){
|
|
@@ -289,7 +291,7 @@ class Menu extends Base
|
|
|
|
|
|
$result = Db::name("admin_menu")->insert($data);
|
|
|
if($result){
|
|
|
- write_log("菜单{$data['menu_name']}新建成功",$this->userinfo,"菜单模块","菜单新建","后台管理员");
|
|
|
+ write_log("菜单{$data['menu_name']}新建成功",$this->userinfo,"order","add","0");
|
|
|
return app_show(0,"添加成功");
|
|
|
}else{
|
|
|
return error_show(1003,"添加失败");
|
|
@@ -319,7 +321,7 @@ class Menu extends Base
|
|
|
$img = isset($this->post['img']) ?trim($this->post['img']) :"";
|
|
|
$pid = isset($this->post['pid']) ?intval($this->post['pid']) :0;
|
|
|
$weight = isset($this->post['weight']) ?floatval($this->post['weight']) :1;
|
|
|
- $status = isset($this->post['is_show']) ? intval($this->post['is_show']) : 0;
|
|
|
+ $is_show = isset($this->post['is_show']) ? intval($this->post['is_show']) : 0;
|
|
|
$private = isset($this->post['private']) ?intval($this->post['private']) :(isset($menu['is_private']) ?
|
|
|
$menu['is_private'] : 0);
|
|
|
if($pid!=0 && $route==""){
|
|
@@ -332,7 +334,7 @@ class Menu extends Base
|
|
|
"menu_code"=>$code,
|
|
|
"menu_img"=>$img,
|
|
|
"pid"=>$pid,
|
|
|
- 'is_show'=>1,
|
|
|
+ 'is_show'=>$is_show,
|
|
|
"is_private"=>$private,
|
|
|
'status'=>1,
|
|
|
"weight"=>$weight,
|
|
@@ -345,7 +347,7 @@ class Menu extends Base
|
|
|
$result = Db::name("admin_menu")->insert($data); $msh ="新建";
|
|
|
}
|
|
|
if($result){
|
|
|
- write_log("菜单{$data['menu_name']}{$msh}成功",$this->userinfo,"菜单模块","菜单编辑","后台管理员");
|
|
|
+ write_log("菜单{$data['menu_name']}{$msh}成功",$this->userinfo,"order",$id==""?"add":"edit","0");
|
|
|
return app_show(0,"{$msh}成功");
|
|
|
}else{
|
|
|
return error_show(1003,"{$msh}失败");
|
|
@@ -361,9 +363,9 @@ class Menu extends Base
|
|
|
$menu['is_show']=0;
|
|
|
$menu['status']=0;
|
|
|
$menu['updatetime']=date("Y-m-d H:i:s");
|
|
|
- $result = Db::name("admin_menu")->save($menu);
|
|
|
+ $result = Db::name("admin_menu")->update($menu);
|
|
|
if($result){
|
|
|
- write_log("菜单{$menu['menu_name']}删除成功",$this->userinfo,"菜单模块","菜单删除","后台管理员");
|
|
|
+ write_log("菜单{$menu['menu_name']}删除成功",$this->userinfo,"order","del","0");
|
|
|
return app_show(0,"删除成功");
|
|
|
}else{
|
|
|
return error_show(1003,"删除失败");
|
|
@@ -386,7 +388,7 @@ class Menu extends Base
|
|
|
$result = Db::name("admin_menu")->update($menu);
|
|
|
$msg=$statu==1?"启用":"禁用";
|
|
|
if($result){
|
|
|
- write_log("菜单{$menu['menu_name']}{$msg}成功",$this->userinfo,"菜单模块","菜单状态","后台管理员");
|
|
|
+ write_log("菜单{$menu['menu_name']}{$msg}成功",$this->userinfo,"order","status","0");
|
|
|
return app_show(0,"状态更新成功");
|
|
|
}else{
|
|
|
return error_show(1003,"状态更新失败");
|