optimize
wet 2 years ago
parent 12394e5bdc
commit f3f03c3b40

@ -77,15 +77,15 @@ public class SysUserService : ISysUserService, IDynamicApiController, ITransient
o.Pids.Contains(pid.Trim()))
.WhereIF(Enum.IsDefined(typeof(CommonStatus), input.SearchStatus), (u, e, o) => u.Status == input.SearchStatus)
.Where((u, e, o) => u.AdminType == AdminType.None)
.Select<UserOutput>("u.*,t.Name As TenantName ").ToDataFilter("u", "Id", FilterType.User)
.Select<UserOutput>("u.*,t.Name As TenantName,o.name as orgName ").ToDataFilter("u", "Id", FilterType.User)
.OrderBy(PageInputOrder.OrderBuilder(input.SortField, input.DescSort)).
ToPagedListAsync(input.PageNo, input.PageSize);
var empInfos = await _sysEmpService.GetEmpInfo(users.Items.Select(m => long.Parse(m.Id)).ToList());
foreach (var user in users.Items)
{
user.SysEmpInfo = empInfos.FirstOrDefault(m => m.Id == long.Parse(user.Id));
}
//var empInfos = await _sysEmpService.GetEmpInfo(users.Items.Select(m => long.Parse(m.Id)).ToList());
//foreach (var user in users.Items)
//{
// user.SysEmpInfo = empInfos.FirstOrDefault(m => m.Id == long.Parse(user.Id));
//}
//foreach (var user in users.Items)
//{

Loading…
Cancel
Save