Example #1
0
        public virtual async Task <PageListResultDto <RentsaleinfoListDto> > GetMyRentsaleinfos(string memberId, int type, GetPageListRequstDto dto)
        {
            var query = _rentsaleinfoRepository.GetAll();

            var where = FilterExpression.FindByGroup <Rentsaleinfo>(dto.Filter);
            where     = where.And(t => t.MemberId == memberId);
            switch (type)
            {
            case 0:
                where = where.And(t => !t.IsShow);
                break;

            case 1:
                where = where.And(t => t.IsShow && t.IsSale);
                break;

            case 2:
                where = where.And(t => t.IsShow && !t.IsSale);
                break;
            }

            var count = await query.Where(where).CountAsync();

            var list = await query.Where(where).OrderByDescending(t => t.CreationTime).PageBy(dto).ToListAsync();

            var pageList = list.MapTo <List <RentsaleinfoListDto> >();

            return(new PageListResultDto <RentsaleinfoListDto>(count, pageList, dto.CurrentPage, dto.PageSize));
        }
        public async Task <PageListResultDto <SubstationListDto> > GetSubstations(GetPageListRequstDto dto)
        {
            var query = _substationRepository.GetAll(); var where = FilterExpression.FindByGroup <Substation>(dto.Filter);
            var count = await query.Where(where).CountAsync(); var list = await query.Where(where).OrderByDescending(t => t.Sort).PageBy(dto).ToListAsync();

            var pageList = list.MapTo <List <SubstationListDto> >(); return(new PageListResultDto <SubstationListDto>(count, pageList, dto.CurrentPage, dto.PageSize));
        }
Example #3
0
        public async Task <PageListResultDto <ForumPostListDto> > GetForumPosts(GetPageListRequstDto dto)
        {
            var query = _forumPostRepository.GetAll();

            var where = FilterExpression.FindByGroup <ForumPost>(dto.Filter);
            var queryCount = query.Where(where)
                             .GroupJoin(_memberRepository.GetAll(), left => left.MemberId, right => right.Id,
                                        (left, right) => new
            {
                Posts  = left,
                Member = right
            })
                             .GroupJoin(_plateRepository.GetAll(), left => left.Posts.PlateId, right => right.Id,
                                        (left, right) => new
            {
                Posts  = left.Posts,
                Member = left.Member,
                Plate  = right
            });


            int count = await queryCount.CountAsync();

            var queryList = query.Where(where)
                            .GroupJoin(_memberRepository.GetAll(), left => left.MemberId, right => right.Id,
                                       (left, right) => new
            {
                Posts  = left,
                Member = right
            })
                            .GroupJoin(_plateRepository.GetAll(), left => left.Posts.PlateId, right => right.Id,
                                       (left, right) => new
            {
                Posts  = left.Posts,
                Member = left.Member,
                Plate  = right
            });

            var list = await queryList.OrderByDescending(t => t.Posts.LastCommentTime).PageBy(dto).ToListAsync();


            var posts = list.Select(item => new ForumPostListDto()
            {
                Id              = item.Posts.Id,
                CommentCount    = item.Posts.CommentCount,
                CreationTime    = item.Posts.CreationTime,
                LastCommentTime = item.Posts.LastCommentTime,
                MemberName      = item.Member.FirstOrDefault()?.Name,
                PlateName       = item.Plate.FirstOrDefault()?.Name,
                ReadCount       = item.Posts.ReadCount,
                Title           = item.Posts.Title
            }).ToList();


            return(new PageListResultDto <ForumPostListDto>(count, posts, dto.CurrentPage, dto.PageSize));
        }
Example #4
0
        public async Task <PageListResultDto <ProductCommentListDto> > GetProductComments(GetPageListRequstDto dto)
        {
            var query = _productCommentRepository.GetAll();

            var where = FilterExpression.FindByGroup <ProductComment>(dto.Filter);


            var queryCount = query.Where(where)
                             .GroupJoin(_memberRepository.GetAll(), left => left.MemberId, right => right.Id, (left, right) => new
            {
                ProductComment = left,
                Member         = right
            })
                             .GroupJoin(_productRepository.GetAll(), left => left.ProductComment.ProductId, right => right.Id, (left, right) => new
            {
                ProductComment = left.ProductComment,
                Member         = left.Member,
                Product        = right
            });


            int count = await queryCount.CountAsync();



            var queryList = query.Where(where)
                            .GroupJoin(_memberRepository.GetAll(), left => left.MemberId, right => right.Id, (left, right) => new
            {
                ProductComment = left,
                Member         = right
            })
                            .GroupJoin(_productRepository.GetAll(), left => left.ProductComment.ProductId, right => right.Id, (left, right) => new
            {
                ProductComment = left.ProductComment,
                Member         = left.Member,
                Product        = right
            });



            var comments = await queryList.OrderByDescending(t => t.ProductComment.CreationTime).PageBy(dto).ToListAsync();


            List <ProductCommentListDto> Comments = comments.Select(comment => new ProductCommentListDto()
            {
                Id           = comment.ProductComment.Id,
                ProductName  = comment.Product.FirstOrDefault()?.Name,
                MemberName   = comment.Member.FirstOrDefault()?.Name,
                Content      = comment.ProductComment.Content,
                CreationTime = comment.ProductComment.CreationTime
            }).ToList();

            return(new PageListResultDto <ProductCommentListDto>(count, Comments, dto.CurrentPage, dto.PageSize));
        }
        public async Task <PageListResultDto <WeixinSubscribeListDto> > GetWeixinSubscribes(GetPageListRequstDto dto)
        {
            var query = _WeixinSubscribeRepository.GetAll(); var where = FilterExpression.FindByGroup <WeixinSubscribe>(dto.Filter);
            var count = await query.Where(where).CountAsync();

            var list = await query.Where(where).OrderBy(t => t.Sort).PageBy(dto).ToListAsync();

            var pageList = list.MapTo <List <WeixinSubscribeListDto> >();

            return(new PageListResultDto <WeixinSubscribeListDto>(count, pageList, dto.CurrentPage, dto.PageSize));
        }
Example #6
0
        public async Task <PageListResultDto <ActivityPersonListDto> > GetActivityPersons(long activityId, GetPageListRequstDto dto)
        {
            var query = _activityPersonRepository.GetAll();

            var where = FilterExpression.FindByGroup <ActivityPerson>(dto.Filter);
            where     = where.And(t => t.ActivityId == activityId);
            var count = await query.Where(where).CountAsync();

            var list = await query.Where(where).OrderByDescending(t => t.CreationTime).PageBy(dto).ToListAsync();

            var pageList = list.MapTo <List <ActivityPersonListDto> >();

            return(new PageListResultDto <ActivityPersonListDto>(count, pageList, dto.CurrentPage, dto.PageSize));
        }
Example #7
0
        public async Task <PageListResultDto <GrouponListDto> > GetGroupons(GetPageListRequstDto dto)
        {
            var query = _grouponRepository.GetAll();

            var where = FilterExpression.FindByGroup <Groupon>(dto.Filter);
            var queryCount = query.Where(where)
                             .GroupJoin(_productRepository.GetAll(), left => left.ProductId, right => right.Id,
                                        (left, right) => new
            {
                Groupon = left,
                Product = right
            });

            //if (FilterExpression.HasValue(dto.Filter, "userName"))
            //{
            //    string value = FilterExpression.GetValue(input.Filter, "userName");
            //    queryCount = queryCount.Where(t => t.User.FirstOrDefault().Name.Contains(value));
            //}

            int count = await queryCount.CountAsync();

            var queryList = query.Where(where)
                            .GroupJoin(_productRepository.GetAll(), left => left.ProductId, right => right.Id,
                                       (left, right) => new
            {
                Groupon = left,
                Product = right
            });

            //var list = queryList.OrderByDescending(t => t.Groupon.CreationTime).PageBy(dto).ToListAsync();

            var tts = await queryList.Select(t => new GrouponAndProduct()
            {
                Groupon = t.Groupon,
                Product = t.Product.FirstOrDefault()
            }).OrderByDescending(t => t.Groupon.CreationTime).PageBy(dto).ToListAsync();

            var grouponListDtos = tts.Select(
                result =>
            {
                var auditLogListDto       = result.Groupon.MapTo <GrouponListDto>();
                auditLogListDto.Name      = result.Product?.Name;
                auditLogListDto.Thumbnail = result.Product?.Thumbnail;
                return(auditLogListDto);
            }).ToList();

            var pageList = grouponListDtos.MapTo <List <GrouponListDto> >();

            return(new PageListResultDto <GrouponListDto>(count, pageList, dto.CurrentPage, dto.PageSize));
        }
        public async Task <PageListResultDto <ProductSlideImageListDto> > GetSlideImages(long productId, GetPageListRequstDto dto)
        {
            var query = _slideimageRepository.GetAll();

            var where = FilterExpression.FindByGroup <ProductSlideImage>(dto.Filter);
            where     = where.And(t => t.ProductId == productId);
            var count = await query.Where(where).CountAsync();

            var list = await query.Where(where).OrderBy(t => t.Sort).PageBy(dto).ToListAsync();

            var pageList = list.MapTo <List <ProductSlideImageListDto> >();

            return(new PageListResultDto <ProductSlideImageListDto>(count, pageList, dto.CurrentPage, dto.PageSize));
        }
Example #9
0
        public async Task <PageListResultDto <NoticeListDto> > GetNotices(GetPageListRequstDto dto)
        {
            var query = _noticeRepository.GetAll();

            var where = FilterExpression.FindByGroup <Notice>(dto.Filter);
            var count = await query.Where(where).CountAsync();

            var list = await query
                       .Where(where)
                       .OrderByDescending(t => t.Sort)
                       .PageBy(dto).ToListAsync();

            var pageList = list.MapTo <List <NoticeListDto> >();

            #region 包装项目名称
            foreach (var listDto in pageList)
            {
                if (listDto.AllProjects)
                {
                    continue;
                }

                var q1 = _noticeProjectRepository.GetAll().Where(t => t.NoticeId == listDto.Id)
                         .GroupJoin(_projectRepository.GetAll(), left => left.ProjectId, right => right.Id,
                                    (left, right) => new
                {
                    NoticeProjects = left,
                    Project        = right
                });
                var projects = await q1.ToListAsync();

                var pnames = projects.Select(t =>
                {
                    var firstOrDefault = t.Project.FirstOrDefault();
                    if (firstOrDefault != null)
                    {
                        return(firstOrDefault.Name);
                    }
                    else
                    {
                        return("");
                    }
                }).ToList();
                listDto.ProjectNames = pnames;
            }
            #endregion

            return(new PageListResultDto <NoticeListDto>(count, pageList, dto.CurrentPage, dto.PageSize));
        }
Example #10
0
        public virtual async Task <AppPagedResultOutput <SoftListDto> > GetPageList(GetPageListInput input)
        {
            var query = _softRepository.GetAll();

            var where = FilterExpression.FindByGroup <Soft>(input.Filter);
            var count = await query.Where(where).CountAsync();

            var list = await query.Where(where)
                       .OrderByDescending(t => t.CreationTime)
                       .PageBy(input)
                       .ToListAsync();

            var pageList = list.MapTo <List <SoftListDto> >();

            return(new AppPagedResultOutput <SoftListDto>(count, pageList, input.CurrentPage, input.PageSize));
        }
Example #11
0
        public virtual async Task <AppPagedResultOutput <MCodeChangeLogListDto> > GetMCodeChangeLogPageList(long softUserLicenseId, GetPageListInput input)
        {
            var query = _mCodeChangeLogRepository.GetAll();

            var where = FilterExpression.FindByGroup <MCodeChangeLog>(input.Filter);
            where     = where.And(t => t.SoftUserLicenseId == softUserLicenseId);
            var count = await query.Where(where).CountAsync();

            var list = await query.Where(where)
                       .OrderByDescending(t => t.CreationTime)
                       .PageBy(input)
                       .ToListAsync();

            var pageList = list.MapTo <List <MCodeChangeLogListDto> >();

            return(new AppPagedResultOutput <MCodeChangeLogListDto>(count, pageList, input.CurrentPage, input.PageSize));
        }
Example #12
0
        public virtual async Task <PageListResultDto <RentsaleinfoListDto> > GetRentsaleinfos(int mode, GetPageListRequstDto dto)
        {
            var query = _rentsaleinfoRepository.GetAll();

            var where = FilterExpression.FindByGroup <Rentsaleinfo>(dto.Filter);
            where     = where.And(t => t.IsSale && t.IsShow);
            if (mode != 0)
            {
                where = where.And(t => t.RentsaleinfoTypeId == mode);
            }
            var count = await query.Where(where).CountAsync();

            var list = await query.Where(where).OrderByDescending(t => t.CreationTime).PageBy(dto).ToListAsync();

            var pageList = list.MapTo <List <RentsaleinfoListDto> >();

            return(new PageListResultDto <RentsaleinfoListDto>(count, pageList, dto.CurrentPage, dto.PageSize));
        }
Example #13
0
        public async Task <PageListResultDto <RefundOrderListDto> > GetRefundOrders(GetPageListRequstDto dto)
        {
            var query = _refundOrderRepository.GetAll();

            var where = FilterExpression.FindByGroup <RefundOrder>(dto.Filter);

            var queryCount = query.Where(where);

            int count = await queryCount.CountAsync();

            var queryList = query.Where(where);

            var tts = await queryList.OrderByDescending(t => t.CreationTime).PageBy(dto).ToListAsync();

            var pageList = tts.MapTo <List <RefundOrderListDto> >();


            return(new PageListResultDto <RefundOrderListDto>(count, pageList, dto.CurrentPage, dto.PageSize));
        }
Example #14
0
        public virtual async Task <AppPagedResultOutput <SoftLicenseListDto> > GetLicensePageList(long softId, GetPageListInput input)
        {
            var query = _softLicenseRepository.GetAll();

            var where = FilterExpression.FindByGroup <SoftLicense>(input.Filter);
            where     = where.And(t => t.SoftId == softId);


            var queryCount = query.Where(where)
                             .GroupJoin(_softUserRepository.GetAll(), softLicense => softLicense.SoftUserId, softUser => softUser.Id,
                                        (softLicense, softUser) => new
            {
                SoftLicense = softLicense,
                SoftUser    = softUser
            });

            if (FilterExpression.HasValue(input.Filter, "loginName"))
            {
                string value = FilterExpression.GetValue(input.Filter, "loginName");
                queryCount = queryCount.Where(t => t.SoftUser.FirstOrDefault().LoginName.Contains(value));
            }

            int count = await queryCount.CountAsync();


            var queryList = query.Where(where)
                            .GroupJoin(_softUserRepository.GetAll(), softLicense => softLicense.SoftUserId, softUser => softUser.Id,
                                       (softLicense, softUser) => new
            {
                SoftLicense = softLicense,
                SoftUser    = softUser
            });


            //queryList = queryList.Where(t => t.SoftUser.FirstOrDefault().LoginName.Contains("001"));
            if (FilterExpression.HasValue(input.Filter, "loginName"))
            {
                string value = FilterExpression.GetValue(input.Filter, "loginName");
                queryList = queryList.Where(t => t.SoftUser.FirstOrDefault().LoginName.Contains(value));
            }


            queryList = queryList.OrderByDescending(t => t.SoftLicense.CreationTime)
                        .PageBy(input);
            var list = await queryList.Select(t => new SoftLicenseListDto
            {
                Id                 = t.SoftLicense.Id,
                ApplyTime          = t.SoftLicense.ApplyTime,
                CreationTime       = t.SoftLicense.CreationTime,
                LicenseNo          = t.SoftLicense.LicenseNo,
                LicenseType        = t.SoftLicense.LicenseType,
                Price              = t.SoftLicense.Price,
                Status             = t.SoftLicense.Status,
                UseTime            = t.SoftLicense.UseTime,
                SoftUser_LoginName = t.SoftUser.FirstOrDefault().LoginName
            }).ToListAsync();

            var pageList = list;

            return(new AppPagedResultOutput <SoftLicenseListDto>(count, pageList, input.CurrentPage, input.PageSize));
        }
Example #15
0
        public virtual async Task <AppPagedResultOutput <SoftUserLoginListDto> > GetLoginPageList(GetPageListInput input)
        {
            var query = _softUserLoginRepository.GetAll();

            var where = FilterExpression.FindByGroup <SoftUserLogin>(input.Filter);


            var queryCount = query.Where(where)
                             .GroupJoin(_softUserRepository.GetAll(), left => left.SoftUserId, right => right.Id,
                                        (left, right) => new
            {
                UserLicense = left,
                SoftUser    = right
            })
                             .GroupJoin(_softRepository.GetAll(), left => left.UserLicense.SoftId, right => right.Id,
                                        (left, right) => new
            {
                SoftUserLicense = left.UserLicense,
                SoftUser        = left.SoftUser,
                Soft            = right
            });

            if (FilterExpression.HasValue(input.Filter, "loginName"))
            {
                string value = FilterExpression.GetValue(input.Filter, "loginName");
                queryCount = queryCount.Where(t => t.SoftUser.FirstOrDefault().LoginName.Contains(value));
            }

            if (FilterExpression.HasValue(input.Filter, "softName"))
            {
                string value = FilterExpression.GetValue(input.Filter, "softName");
                queryCount = queryCount.Where(t => t.Soft.FirstOrDefault().Name.Contains(value));
            }

            int count = await queryCount.CountAsync();


            var queryList = query.Where(where)
                            .GroupJoin(_softUserRepository.GetAll(), left => left.SoftUserId, right => right.Id,
                                       (left, right) => new
            {
                SoftUserLogin = left,
                SoftUser      = right
            })
                            .GroupJoin(_softRepository.GetAll(), left => left.SoftUserLogin.SoftId, right => right.Id,
                                       (left, right) => new
            {
                SoftUserLogin = left.SoftUserLogin,
                SoftUser      = left.SoftUser,
                Soft          = right
            });

            if (FilterExpression.HasValue(input.Filter, "loginName"))
            {
                string value = FilterExpression.GetValue(input.Filter, "loginName");
                queryList = queryList.Where(t => t.SoftUser.FirstOrDefault().LoginName.Contains(value));
            }

            if (FilterExpression.HasValue(input.Filter, "softName"))
            {
                string value = FilterExpression.GetValue(input.Filter, "softName");
                queryList = queryList.Where(t => t.Soft.FirstOrDefault().Name.Contains(value));
            }


            queryList = queryList.OrderByDescending(t => t.SoftUserLogin.CreationTime)
                        .PageBy(input);
            var list = await queryList.Select(t => new SoftUserLoginListDto
            {
                Id           = t.SoftUserLogin.Id,
                Mcode        = t.SoftUserLogin.Mcode,
                Ip           = t.SoftUserLogin.Ip,
                CreationTime = t.SoftUserLogin.CreationTime,
                SoftName     = t.Soft.FirstOrDefault().Name,
                LoginName    = t.SoftUser.FirstOrDefault().LoginName
            }).ToListAsync();

            var pageList = list;

            return(new AppPagedResultOutput <SoftUserLoginListDto>(count, pageList, input.CurrentPage, input.PageSize));
        }
 public async Task <PageListResultDto <NewsProjectListDto> > GetNewsProjects(GetPageListRequstDto dto)
 {
     var query = _newsprojectRepository.GetAll(); var where = FilterExpression.FindByGroup <NewsProject>(dto.Filter); var count = await query.Where(where).CountAsync(); var list = await query.Where(where).OrderByDescending(t => t.CreationTime).PageBy(dto).ToListAsync(); var pageList = list.MapTo <List <NewsProjectListDto> >(); return(new PageListResultDto <NewsProjectListDto>(count, pageList, dto.CurrentPage, dto.PageSize));
 }
Example #17
0
        public async Task <PageListResultDto <CommentListItem> > GetCommentList(int postId, GetPageListRequstDto dto)
        {
            var query = _forumCommentRepository.GetAll();

            var where = FilterExpression.FindByGroup <ForumComment>(dto.Filter);
            var queryCount = query.Where(where)
                             .GroupJoin(_memberRepository.GetAll(), left => left.MemberId, right => right.Id,
                                        (left, right) => new
            {
                PostComment = left,
                Member      = right
            });

            queryCount = queryCount.Where(t => t.PostComment.ForumPostId == postId);
            int count = await queryCount.CountAsync();



            var queryList = query.Where(where).GroupJoin(_memberRepository.GetAll(), left => left.MemberId, right => right.Id,
                                                         (left, right) => new
            {
                PostComment = left,
                Member      = right
            });

            queryList = queryList.Where(t => t.PostComment.ForumPostId == postId);
            var list = await queryList.OrderByDescending(t => t.PostComment.CreationTime).PageBy(dto).ToListAsync();

            List <CommentListItem> comments = new List <CommentListItem>();

            foreach (var comment in list)
            {
                comments.Add(new CommentListItem()
                {
                    Id              = comment.PostComment.Id,
                    Images          = new List <string>(),
                    Content         = comment.PostComment.Content,
                    CreationTime    = comment.PostComment.CreationTime,
                    Floor           = comment.PostComment.Floor,
                    MemberName      = comment.Member.FirstOrDefault()?.Name,
                    MemberBindRooms = comment.Member.FirstOrDefault()?.BindRooms,
                    MemberThumbnail = comment.Member.FirstOrDefault()?.Thumbnail
                });
            }

            foreach (var comment in comments)
            {
                var iamges1 =
                    await
                    _forumImageRepository.GetAll()
                    .Where(t => t.OwnerId == comment.Id && t.Type == ForumImageType.Comment)
                    .OrderBy(t => t.Id)
                    .ToListAsync();

                foreach (var iamge in iamges1)
                {
                    comment.Images.Add(iamge.Image);
                }
            }


            return(new PageListResultDto <CommentListItem>(count, comments, dto.CurrentPage, dto.PageSize));
        }
Example #18
0
        public async Task <PageListResultDto <OrderListDto> > GetOrders(GetPageListRequstDto dto)
        {
            var query = _orderRepository.GetAll();

            var where = FilterExpression.FindByGroup <Order>(dto.Filter);

            var queryCount = query.Where(where)
                             .GroupJoin(_orderProductRepository.GetAll(), left => left.Id, right => right.OrderId,
                                        (left, right) => new
            {
                Order        = left,
                OrderProduct = right
            })
                             .GroupJoin(_memberRepository.GetAll(), left => left.Order.MemberId, right => right.Id,
                                        (left, right) => new
            {
                Order        = left.Order,
                OrderProduct = left.OrderProduct,
                Member       = right
            });

            int count = await queryCount.CountAsync();

            var queryList = query.Where(where)
                            .GroupJoin(_orderProductRepository.GetAll(), left => left.Id, right => right.OrderId,
                                       (left, right) => new
            {
                Order        = left,
                OrderProduct = right
            }).GroupJoin(_memberRepository.GetAll(), left => left.Order.MemberId, right => right.Id,
                         (left, right) => new
            {
                Order        = left.Order,
                OrderProduct = left.OrderProduct,
                Member       = right
            });

            var tts = await queryList.OrderByDescending(t => t.Order.CreationTime).PageBy(dto).ToListAsync();

            var pageList = new List <OrderListDto>();

            foreach (var tt in tts)
            {
                pageList.Add(new OrderListDto()
                {
                    Id            = tt.Order.Id,
                    Amount        = tt.Order.Amount,
                    GrouponStatus = tt.Order.GrouponStatus,
                    OrderId       = tt.Order.Id,
                    ProductName   = tt.OrderProduct.FirstOrDefault()?.Name,
                    Status        = tt.Order.Status,
                    Type          = tt.Order.Type,
                    Thumbnail     = tt.OrderProduct.FirstOrDefault()?.Thumbnail,
                    OrderNo       = tt.Order.OrderNo,
                    Address       = tt.Order.Address,
                    Contact       = tt.Order.Contact,
                    Mobile        = tt.Order.Mobile,
                    CreationTime  = tt.Order.CreationTime,
                    MemberName    = tt.Member.FirstOrDefault()?.Name,
                    RefundStatus  = tt.Order.RefundStatus
                });
            }

            return(new PageListResultDto <OrderListDto>(count, pageList, dto.CurrentPage, dto.PageSize));
        }
Example #19
0
        public async Task <PageListResultDto <PostListItem> > GetMyCommentList(long memberId, GetPageListRequstDto dto)
        {
            var query = _forumPostRepository.GetAll();

            var where = FilterExpression.FindByGroup <ForumPost>(dto.Filter);
            var queryCount = query.Where(where)
                             .GroupJoin(_memberRepository.GetAll(), left => left.MemberId, right => right.Id,
                                        (left, right) => new
            {
                Posts  = left,
                Member = right
            })
                             .GroupJoin(_plateRepository.GetAll(), left => left.Posts.PlateId, right => right.Id,
                                        (left, right) => new
            {
                Posts  = left.Posts,
                Member = left.Member,
                Plate  = right
            })
                             .Join(_forumCommentRepository.GetAll(), left => left.Posts.Id, right => right.ForumPostId,
                                   (left, right) => new
            {
                Posts    = left.Posts,
                Member   = left.Member,
                Plate    = left.Plate,
                Comments = right
            });

            queryCount = queryCount.Where(t => t.Comments.MemberId == memberId);

            int count = await queryCount.CountAsync();

            var queryList = query.Where(where)
                            .GroupJoin(_memberRepository.GetAll(), left => left.MemberId, right => right.Id,
                                       (left, right) => new
            {
                Posts  = left,
                Member = right
            })
                            .GroupJoin(_plateRepository.GetAll(), left => left.Posts.PlateId, right => right.Id,
                                       (left, right) => new
            {
                Posts  = left.Posts,
                Member = left.Member,
                Plate  = right
            }).Join(_forumCommentRepository.GetAll(), left => left.Posts.Id, right => right.ForumPostId,
                    (left, right) => new
            {
                Posts    = left.Posts,
                Member   = left.Member,
                Plate    = left.Plate,
                Comments = right
            });

            queryList = queryList.Where(t => t.Comments.MemberId == memberId);
            var list = await queryList.OrderByDescending(t => t.Posts.LastCommentTime).PageBy(dto).ToListAsync();

            var posts = new List <PostListItem>();

            foreach (var item in list)
            {
                if (posts.Any(t => t.Id == item.Posts.Id))
                {
                    continue;
                }

                posts.Add(new PostListItem()
                {
                    Id              = item.Posts.Id,
                    CommentCount    = item.Posts.CommentCount,
                    CreationTime    = item.Posts.CreationTime,
                    MemberBindRooms = item.Member.FirstOrDefault()?.BindRooms,
                    MemberName      = item.Member.FirstOrDefault()?.Name,
                    MemberThumbnail = item.Member.FirstOrDefault()?.Thumbnail,
                    Images          = new List <string>(),
                    PlateName       = item.Plate.FirstOrDefault()?.Name,
                    ReadCount       = item.Posts.ReadCount,
                    Title           = item.Posts.Title,
                    Summary         = item.Posts.Summary
                });
            }

            //var posts = list.Select(item => new PostListItem()
            //{
            //    Id = item.Posts.Id,
            //    CommentCount = item.Posts.CommentCount,
            //    CreationTime = item.Posts.CreationTime,
            //    MemberBindRooms = item.Member.FirstOrDefault()?.BindRooms,
            //    MemberName = item.Member.FirstOrDefault()?.Name,
            //    MemberThumbnail = item.Member.FirstOrDefault()?.Thumbnail,
            //    Images = new List<string>(),
            //    PlateName = item.Plate.FirstOrDefault()?.Name,
            //    ReadCount = item.Posts.ReadCount,
            //    Title = item.Posts.Title,
            //    Summary = item.Posts.Summary
            //}).ToList();

            foreach (var post in posts)
            {
                var iamges =
                    await
                    _forumImageRepository.GetAll()
                    .Where(t => t.OwnerId == post.Id && t.Type == ForumImageType.Posts)
                    .OrderBy(t => t.Id)
                    .Take(3)
                    .ToListAsync();

                foreach (var iamge in iamges)
                {
                    post.Images.Add(iamge.Image);
                }
            }

            return(new PageListResultDto <PostListItem>(count, posts, dto.CurrentPage, dto.PageSize));
        }