lihao 4 anni fa
parent
commit
0963252ff1

+ 7 - 1
gx_api/GxPress/Model/GxPress.Result/Department/DepartmentUserResult.cs

@@ -11,10 +11,16 @@ namespace GxPress.Result.Department
         /// <summary>
         /// 下级部门
         /// </summary>
-        public IEnumerable<DepartmentResult> Departments { get; set; }
+        public List<DepartmentResult> Departments { get; set; }
         /// <summary>
         /// 成员
         /// </summary>
         public List<UserInfoResult> Users { get; set; }
+
+        public DepartmentUserResult()
+        {
+            Departments = new List<DepartmentResult>();
+            Users = new List<UserInfoResult>();
+        }
     }
 }

+ 1 - 1
gx_api/GxPress/Repository/GxPress.Repository.Implement/DepartmentRepository.cs

@@ -219,7 +219,7 @@ namespace GxPress.Repository.Implement
         {
             var result = new DepartmentUserResult();
             var departments = await GetListAsync(request);
-            result.Departments = departments;
+            result.Departments = departments.ToList();
             //获取用户ID
             var departmentUsers = await departmentUserRepository.GetAllAsync<int>(Q.Where(nameof(Entity.DepartmentUser.DepartmentId), request.DepartmentId).Select(nameof(Entity.DepartmentUser.UserId)));
             //判断是否包含该用户