|
@@ -2,6 +2,7 @@
|
|
using Hotline.SeedData;
|
|
using Hotline.SeedData;
|
|
using Hotline.Settings;
|
|
using Hotline.Settings;
|
|
using SqlSugar;
|
|
using SqlSugar;
|
|
|
|
+using XF.Domain.Authentications;
|
|
using XF.Domain.Dependency;
|
|
using XF.Domain.Dependency;
|
|
|
|
|
|
namespace Hotline.Repository.SqlSugar.System
|
|
namespace Hotline.Repository.SqlSugar.System
|
|
@@ -21,6 +22,17 @@ namespace Hotline.Repository.SqlSugar.System
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public async Task<IReadOnlyList<SystemOrganize>> GetOrgJsonForUser(string orgCode)
|
|
|
|
+ {
|
|
|
|
+ var list = await Db.Queryable<SystemOrganize>()
|
|
|
|
+ .Where(it => it.Id.StartsWith(orgCode))
|
|
|
|
+ .OrderBy(d => d.Id)
|
|
|
|
+ .ToTreeAsync(it => it.Children, it => it.ParentId, orgCode.Length > 6 ? orgCode.Substring(0, orgCode.Length - 3) : null);
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
public async Task<IReadOnlyList<SystemOrganize>> GetCanUseOrg()
|
|
public async Task<IReadOnlyList<SystemOrganize>> GetCanUseOrg()
|
|
{
|
|
{
|
|
var list = await Db.Queryable<SystemOrganize>()
|
|
var list = await Db.Queryable<SystemOrganize>()
|