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

+ 2 - 1
gx_api/GxPress/Service/GxPress.Service.Implement/UserService.cs

@@ -368,7 +368,8 @@ namespace GxPress.Service.Implement
             var user = await _userRepository.GetAsync(userId);
             //单位通讯录
             var userLinkResult = new List<UserLinkModelResult>();
-            if (user.DepartmentId > 0)
+            var departmentCount = await friendsRepository.GetFriendsIdsAsync(userId, -1);
+            if (departmentCount.Count() > 0)
             {
                 var departments = await _departmentRepository.GetAllAsync(Q.Where(nameof(Entity.Department.ParentId), 0));
                 var userLinkModelAttributeResult = new List<UserLinkModelAttributeResult>();