This commit is contained in:
tanglong 2025-06-09 16:28:11 +08:00
parent a85d543c36
commit 89dca4e2d2

View File

@ -225,7 +225,7 @@ namespace VOL.Business.Services.School
var schoolModel = await (from s in _schoolRepository.DbContext.Set<S_School>() var schoolModel = await (from s in _schoolRepository.DbContext.Set<S_School>()
join u in _userRepository.DbContext.Set<Sys_User>() join u in _userRepository.DbContext.Set<Sys_User>()
on s.SchoolCode equals u.SchoolCode on s.SchoolCode equals u.SchoolCode
where u.Role_Id == 2 && s.SchoolCode == schoolCode where (u.Role_Id == 2 || u.Role_Id == 4) && s.SchoolCode == schoolCode
select new SchoolPageListModel() select new SchoolPageListModel()
{ {
Id = s.Id, Id = s.Id,
@ -265,7 +265,7 @@ namespace VOL.Business.Services.School
schoolModel.ModifyDate = DateTime.Now; schoolModel.ModifyDate = DateTime.Now;
schoolModel.Modifier = UserContext.Current.UserId; schoolModel.Modifier = UserContext.Current.UserId;
var user = await _userRepository.FindAsyncFirst(x => x.UserName == paramDto.UserName && x.Role_Id == 2); var user = await _userRepository.FindAsyncFirst(x => x.UserName == paramDto.UserName && x.Role_Id == 2 || x.Role_Id == 4);
if (user == null) if (user == null)
throw new Exception($"未找到用户名为{paramDto.UserName}的学校"); throw new Exception($"未找到用户名为{paramDto.UserName}的学校");