修改在线教师查询bug

development
温天培 1 year ago
parent 2ef6592793
commit ab26dd1b08

@ -100,7 +100,7 @@ namespace GDZZ.Application
List<UserOutput> userls = new List<UserOutput>(); List<UserOutput> userls = new List<UserOutput>();
var users = await this._sysUserRep.AsQueryable().Filter("TenantId", true) var users = await this._sysUserRep.AsQueryable().Filter("TenantId", true)
.LeftJoin<OnlineUser>((u, o) => u.Id == o.UserId) .LeftJoin<OnlineUser>((u, o) => u.Id == o.UserId)
.Where((u, o) => u.AdminType == AdminType.None) .Where((u, o) => u.AdminType == AdminType.None&&o.ConnectionId !=null)
.Select((u, o) => new UserOutput .Select((u, o) => new UserOutput
{ {
Account = u.Account, Account = u.Account,
@ -116,7 +116,8 @@ namespace GDZZ.Application
Tel = u.Tel, Tel = u.Tel,
TenantId = u.TenantId, TenantId = u.TenantId,
ConnectionId = o.ConnectionId, ConnectionId = o.ConnectionId,
Profile = u.Profile Profile = u.Profile,
}) })
.ToListAsync(); .ToListAsync();
@ -125,7 +126,8 @@ namespace GDZZ.Application
{ {
var userDto = user.Adapt<UserOutput>(); var userDto = user.Adapt<UserOutput>();
userDto.SysEmpInfo = await _sysEmpService.GetEmpTSInfo(long.Parse(user.Id)); userDto.SysEmpInfo = await _sysEmpService.GetEmpTSInfo(long.Parse(user.Id));
if(!userDto.SysEmpInfo.Positions.Count.IsNullOrZero())
if (!userDto.SysEmpInfo.Positions.Count.IsNullOrZero())
userls.Add(userDto); userls.Add(userDto);
} }

Loading…
Cancel
Save