李昊 4 年之前
父节点
当前提交
08a47e2946
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      gx_api/GxPress/Repository/GxPress.Repository.Implement/UserRepository.cs

+ 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)