Dun.Jason 1 year ago
parent
commit
717ba74f07

+ 1 - 1
src/Hotline.Repository.SqlSugar/System/SystemOrganizeRepository.cs

@@ -33,7 +33,7 @@ namespace Hotline.Repository.SqlSugar.System
         {
             var list = await Db.Queryable<SystemOrganize>()
                  .Where(it => it.Id.StartsWith(orgCode))
-                .ToTreeAsync(it => it.Children, it => it.ParentId, orgCode.Substring(0, orgCode.Length - 3));
+                .ToTreeAsync(it => it.Children, it => it.ParentId, orgCode.Length > 6 ? orgCode.Substring(0, orgCode.Length - 3) : null);
             return list;
         }