|
@@ -48,7 +48,7 @@ class Menu extends BaseController
|
|
|
if($role==false){
|
|
|
return app_show(0,"获取成功",[]);
|
|
|
}
|
|
|
- $data= Db::name("view_menu")->where('aid',"in",explode(",",$role['action_conllect']))->where(['status'=>1,"cstatus"=>1])
|
|
|
+ $data= Db::name("view_menu")->where('aid',"in",explode(",",$role['action_conllect']))->where(['status'=>1,"cstatus"=>1,"is_display"=>1])
|
|
|
->order("weight desc,id asc,cweight desc,cid asc")->select();
|
|
|
|
|
|
$list=[];
|
|
@@ -84,14 +84,6 @@ class Menu extends BaseController
|
|
|
*/
|
|
|
public function MenuEdit(){
|
|
|
$post =$this->request->post();
|
|
|
- $token = isset($post['token']) ? trim($post['token']) : "";
|
|
|
- if($token==""){
|
|
|
- return error_show(101,'token不能为空');
|
|
|
- }
|
|
|
- $effetc = VerifyTokens($token);
|
|
|
- if(!empty($effetc) && $effetc['code']!=0){
|
|
|
- return error_show($effetc['code'],$effetc['message']);
|
|
|
- }
|
|
|
$id = isset($post['id']) ?intval($post['id']) :"";
|
|
|
if($id!=""){
|
|
|
$menu = Db::name("admin_menu")->where("id","=",$id)->find();
|
|
@@ -145,14 +137,7 @@ class Menu extends BaseController
|
|
|
*/
|
|
|
public function MenuStatus(){
|
|
|
$post =$this->request->post();
|
|
|
- $token = isset($post['token']) ? trim($post['token']) : "";
|
|
|
- if($token==""){
|
|
|
- return error_show(101,'token不能为空');
|
|
|
- }
|
|
|
- $effetc = VerifyTokens($token);
|
|
|
- if(!empty($effetc) && $effetc['code']!=0){
|
|
|
- return error_show($effetc['code'],$effetc['message']);
|
|
|
- }
|
|
|
+
|
|
|
$id = isset($post['id']) ?intval($post['id']) :"";
|
|
|
$menu = Db::name("admin_menu")->where("id","=",$id)->find();
|
|
|
if($menu==false){
|
|
@@ -177,14 +162,7 @@ class Menu extends BaseController
|
|
|
*/
|
|
|
public function MenuAllList(){
|
|
|
$post =$this->request->post();
|
|
|
- $token = isset($post['token']) ? trim($post['token']) : "";
|
|
|
- if($token==""){
|
|
|
- return error_show(101,'token不能为空');
|
|
|
- }
|
|
|
- $effetc = VerifyTokens($token);
|
|
|
- if(!empty($effetc) && $effetc['code']!=0){
|
|
|
- return error_show($effetc['code'],$effetc['message']);
|
|
|
- }
|
|
|
+
|
|
|
$data = Db::name("admin_menu")->where(['pid'=>0,'is_del'=>0])->order("weight desc,id asc")->select();
|
|
|
$l=[];
|
|
|
foreach ($data as $key=>$value){
|
|
@@ -207,14 +185,6 @@ class Menu extends BaseController
|
|
|
|
|
|
public function MenuDel(){
|
|
|
$post =$this->request->post();
|
|
|
- $token = isset($post['token']) ? trim($post['token']) : "";
|
|
|
- if($token==""){
|
|
|
- return error_show(101,'token不能为空');
|
|
|
- }
|
|
|
- $effetc = VerifyTokens($token);
|
|
|
- if(!empty($effetc) && $effetc['code']!=0){
|
|
|
- return error_show($effetc['code'],$effetc['message']);
|
|
|
- }
|
|
|
$id = isset($post['id']) ?intval($post['id']) :"";
|
|
|
$menu = Db::name("admin_menu")->where("id","=",$id)->find();
|
|
|
if($menu==false){
|
|
@@ -228,4 +198,22 @@ class Menu extends BaseController
|
|
|
return $result ? app_show(0,"删除成功"): error_show(1003,"删除失败");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @return \think\response\Json|void
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
+ * @throws \think\db\exception\DbException
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
+ */
|
|
|
+ public function MenuActionDel(){
|
|
|
+ $post =$this->request->post();
|
|
|
+
|
|
|
+ $id = isset($post['id']) ?intval($post['id']) :"";
|
|
|
+ $menu = Db::name("action")->where("id","=",$id)->find();
|
|
|
+ if($menu==false){
|
|
|
+ return error_show(1003,"菜单功能信息不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ $result = Db::name("action")->delete($menu);
|
|
|
+ return $result ? app_show(0,"删除成功"): error_show(1003,"删除失败");
|
|
|
+ }
|
|
|
}
|