Преглед изворни кода

优化获取附件分类列表

evoxwht пре 2 година
родитељ
комит
637aade62a

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

@@ -77,7 +77,11 @@ class SystemAttachmentCategoryServices extends BaseServices
             if ($menu['pid'] == $pid) {
             if ($menu['pid'] == $pid) {
                 unset($menusList[$k]);
                 unset($menusList[$k]);
                 $menu['children'] = $this->tidyMenuTier($menusList, $menu['id']);
                 $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;
                 $navList[] = $menu;
             }
             }
         }
         }