BUG

parent 71183e47
...@@ -30,11 +30,11 @@ public List<HospitalResponse> GetUserHopital(int userid) ...@@ -30,11 +30,11 @@ public List<HospitalResponse> GetUserHopital(int userid)
if (userid <= 0) if (userid <= 0)
throw new PerformanceException($"userid:{userid} 错误"); throw new PerformanceException($"userid:{userid} 错误");
var joinList = _joinRepository.GetEntities(t => t.UserID == userid).ToList(); var joinList = _joinRepository.GetEntities(t => t.UserID == userid);
if (joinList == null && joinList.Count == 0) if (joinList == null && joinList.Count == 0)
return null; return null;
var hosList = _hospitalRepository.GetEntities(t => joinList.Select(j => j.HospitalID).Contains(t.ID)).ToList(); var hosList = _hospitalRepository.GetEntities(t => joinList.Select(j => j.HospitalID).Contains(t.ID));
return Mapper.Map<List<sys_hospital>, List<HospitalResponse>>(hosList); return Mapper.Map<List<sys_hospital>, List<HospitalResponse>>(hosList);
} }
......
...@@ -31,11 +31,11 @@ public List<RoleResponse> GetUserRole(int userid) ...@@ -31,11 +31,11 @@ public List<RoleResponse> GetUserRole(int userid)
if (userid <= 0) if (userid <= 0)
throw new PerformanceException($"userid:{userid} 错误"); throw new PerformanceException($"userid:{userid} 错误");
var joinList = _userroleRepository.GetEntities(t => t.UserID == userid).ToList(); var joinList = _userroleRepository.GetEntities(t => t.UserID == userid);
if (joinList == null && joinList.Count == 0) if (joinList == null && joinList.Count == 0)
return null; return null;
var roles = _roleRepository.GetEntities(t => joinList.Select(j => j.RoleID).Contains(t.ID)).ToList(); var roles = _roleRepository.GetEntities(t => joinList.Select(j => j.RoleID).Contains(t.ID));
return Mapper.Map<List<RoleResponse>>(roles); return Mapper.Map<List<RoleResponse>>(roles);
} }
......
...@@ -296,7 +296,7 @@ public UserResponse UpdatePwd(PasswordRequest request, int userId) ...@@ -296,7 +296,7 @@ public UserResponse UpdatePwd(PasswordRequest request, int userId)
/// <returns></returns> /// <returns></returns>
public List<sys_role> RoleList() public List<sys_role> RoleList()
{ {
var role = _roleRepository.GetEntities(t => t.States == 1).ToList(); var role = _roleRepository.GetEntities(t => t.States == 1);
return role; return role;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment