李昊 4 vuotta sitten
vanhempi
commit
08a47e2946

+ 2 - 1
gx_api/GxPress/Repository/GxPress.Repository.Implement/UserRepository.cs

@@ -666,7 +666,8 @@ namespace GxPress.Repository.Implement
         /// <returns></returns>
         public async Task<IEnumerable<User>> GetUserByDepartmentIdAsync(int departmentId)
         {
-            return await _repository.GetAllAsync(Q.Where(nameof(User.DepartmentId), departmentId));
+            var userIds = await departmentUserRepository.GetUserIdsByDepartmentIdsAsync(new List<int>() { departmentId });
+            return await _repository.GetAllAsync(Q.WhereIn(nameof(User.Id), userIds));
         }
 
         public async Task<IEnumerable<int>> GetUserIdListByDepartmentIdAsync(int departmentId)