|
@@ -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;
|
|
|
}
|