|
|
|
@ -575,14 +575,14 @@ public class SysUserService : ISysUserService, IDynamicApiController, ITransient
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取租户下的用户
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="name"></param>
|
|
|
|
|
/// <param name="name">用户的代码、英文名或中文名</param>
|
|
|
|
|
/// <param name="tenantId">默认0 获取当前用户,可不传 传租户id获取当前租户</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/sysUser/GetTenantUser")]
|
|
|
|
|
public async Task<List<SysUser>> GetTenantUser(string name, long? tenantId = 0)
|
|
|
|
|
{
|
|
|
|
|
return await _sysUserRep.AsQueryable().Filter(null, true)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(name), x => x.Name.Contains(name))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(name), x => x.UserCode.Contains(name) || x.EnName.Contains(name) || x.Name.Contains(name))
|
|
|
|
|
.WhereIF(tenantId == 0, x => x.TenantId == Convert.ToInt64(UserManager.TENANT_ID) && x.Status == CommonStatus.ENABLE && x.IsDeleted == false)
|
|
|
|
|
.WhereIF(tenantId != 0, x => x.TenantId == tenantId)
|
|
|
|
|
.OrderBy(x => x.Name).ToListAsync();
|
|
|
|
|