lihao 4 년 전
부모
커밋
f408999197

+ 18 - 0
gx_api/GxPress/Model/GxPress.Result/App/Group/GroupDetailResult.cs

@@ -170,6 +170,24 @@ namespace GxPress.Result.App.Group
         /// 广场ID
         /// </summary>
         public int GroupCategroyId { get; set; }
+        /// <summary>
+        /// 主要成员
+        /// </summary>
+        /// <value></value>
+        public int MainMemberCount { get; set; }
+        /// <summary>
+        /// 普通成员数量
+        /// </summary>
+        /// <value></value>
+        public int CommonMemberCount { get; set; }
+        /// <summary>
+        /// 主要成员数据
+        /// </summary>
+        public IEnumerable<GroupUserListResult> MainMemberListResult { get; set; }
+        /// <summary>
+        /// 普通成员数据
+        /// </summary>
+        public IEnumerable<GroupUserListResult> CommonMemberListResult { get; set; }
     }
     /// <summary>
     /// 用户小组列表

+ 8 - 0
gx_api/GxPress/Repository/GxPress.Repository.Implement/GroupRepository.cs

@@ -284,6 +284,14 @@ namespace GxPress.Repository.Implement
             groupDetailResult.IsUser = groupUser != null ? groupUser.UserId == request.UserId : false;
             groupDetailResult.CreatedDate = groupDetail.CreatedDate;
             groupDetailResult.QRCoder = StringUtils.AddDomain(groupDetailResult.QRCoder);
+            if (groupDetailResult.GroupUserListResult != null && groupDetailResult.GroupUserListResult.Count() > 0)
+            {
+                var roleIds = new List<GroupUserRoleTyeConst> { GroupUserRoleTyeConst.Admin, GroupUserRoleTyeConst.SuperAdmin };
+                groupDetailResult.MainMemberListResult = groupDetailResult.GroupUserListResult.Where(n => roleIds.Contains(n.GroupUserRoleId));
+                groupDetailResult.MainMemberCount = groupDetailResult.MainMemberListResult.Count();
+                groupDetailResult.CommonMemberListResult = groupDetailResult.GroupUserListResult.Where(n => !roleIds.Contains(n.GroupUserRoleId));
+                groupDetailResult.CommonMemberCount = groupDetailResult.CommonMemberListResult.Count();
+            }
             return groupDetailResult;
         }
         /// <summary>