Procházet zdrojové kódy

增加“获取行政区域树”方法

Signed-off-by: Lzh666 <422235757@qq.com>
Lzh666 před 10 měsíci
rodič
revize
c21837bb0c

+ 10 - 0
Admin.NET/Admin.NET.Core/Service/Region/SysRegionService.cs

@@ -50,6 +50,16 @@ public class SysRegionService : IDynamicApiController, ITransient
         return await _sysRegionRep.GetListAsync(u => u.Pid == input.Id);
     }
 
+    /// <summary>
+    /// 获取行政区域树 🔖
+    /// </summary>
+    /// <returns></returns>
+    [DisplayName("获取行政区域树")]
+    public async Task<List<SysRegion>> GetTree()
+    {
+        return await _sysRegionRep.AsQueryable().ToTreeAsync(u => u.Children, u => u.Pid, null);
+    }
+
     /// <summary>
     /// 增加行政区域 🔖
     /// </summary>