wugg 9 mēneši atpakaļ
vecāks
revīzija
adf0b1f712
2 mainītis faili ar 5 papildinājumiem un 4 dzēšanām
  1. 3 2
      app/admin/model/AdminMenu.php
  2. 2 2
      app/cxinv/model/AdminMenu.php

+ 3 - 2
app/admin/model/AdminMenu.php

@@ -37,10 +37,11 @@ class AdminMenu extends Base
     	return $this->hasMany(Action::class,"action_id")->where(["is_del"=>0]);
    }
    public static function GetMenuBySecod($menuid,$result=[]){
-       $menuArr = self::field("id,menu_name rename,pid")->findOrEmpty($menuid);
+       $menuArr = self::where(['id'=>$menuid])->findOrEmpty();
+
         if(!$menuArr->isEmpty()){
-            $result[]=$menuArr->toArray();
             if($menuArr->pid>0)  self::GetMenuBySecod($menuArr->pid,$result);
+            $result[] = ['id' => $menuid, 'rename' => $menuArr->menu_name, 'pid' => $menuArr->pid];
         }
         return $result;
     }

+ 2 - 2
app/cxinv/model/AdminMenu.php

@@ -32,10 +32,10 @@ class AdminMenu extends Base
     }
     
    public static function GetMenuBySecod($menuid,$result=[]){
-       $menuArr = self::field('id,menu_name rename,pid')->findOrEmpty($menuid);
+      $menuArr = self::where(['id'=>$menuid])->findOrEmpty();
         if(!$menuArr->isEmpty()){
-            $result[]=$menuArr->toArray();
             if($menuArr->pid>0)  self::GetMenuBySecod($menuArr->pid,$result);
+            $result[] = ['id' => $menuid, 'rename' => $menuArr->menu_name, 'pid' => $menuArr->pid];
         }
         return $result;
     }