Просмотр исходного кода

优化获取附件分类列表

evoxwht 2 лет назад
Родитель
Сommit
637aade62a

+ 5 - 1
crmeb/app/services/system/attachment/SystemAttachmentCategoryServices.php

@@ -77,7 +77,11 @@ class SystemAttachmentCategoryServices extends BaseServices
             if ($menu['pid'] == $pid) {
                 unset($menusList[$k]);
                 $menu['children'] = $this->tidyMenuTier($menusList, $menu['id']);
-                if ($menu['children']) $menu['expand'] = true;
+                if (count($menu['children'])) {
+                    $menu['expand'] = true;
+                } else {
+                    unset($menu['children']);
+                }
                 $navList[] = $menu;
             }
         }