|
@@ -64,6 +64,18 @@ namespace GxPress.Service.Implement.Group
|
|
|
query.Where(nameof(Entity.Middle.Middle.MiddleId), groupId);
|
|
|
await _middleRepository.DeleteAsync(query);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ query = Q.NewQuery();
|
|
|
+ query.Where(nameof(Entity.GroupUser.UserId), userId);
|
|
|
+ query.Where(nameof(Entity.GroupUser.GroupId), groupId);
|
|
|
+ await _groupUserRepository.DeleteAsync(query);
|
|
|
+ query = Q.NewQuery();
|
|
|
+ query.Where(nameof(Entity.Middle.Middle.FolderType), AllTypeConst.Group.GetHashCode());
|
|
|
+ query.Where(nameof(Entity.Middle.Middle.MiddleId), groupId);
|
|
|
+ query.Where(nameof(Entity.Middle.Middle.UserId), userId);
|
|
|
+ await _middleRepository.DeleteAsync(query);
|
|
|
+ }
|
|
|
if (groupUser.GroupUserRoleId == GroupUserRoleTyeConst.SuperAdmin)
|
|
|
throw new BusinessException("你的身份是小组创建者,请先转让小组给他人,然后才能退出小组!");
|
|
|
return true;
|