public async Task <ModelPager <VueUserCommReply> > queryUserCommReply(QUserCommReply query) { ModelPager <VueUserCommReply> result = new ModelPager <VueUserCommReply>(query.pageIndex, query.pageSize); var mainSql = Db.Queryable <ECommentReply_Res, EComment_Res, EUserInfo, EBookInfo>((r, c, cu, b) => new object[] { JoinType.Inner, r.commentId == c.Id, JoinType.Inner, r.authorId == cu.Id, JoinType.Inner, c.parentRefCode == b.Code, }) .Where((r, c, cu, b) => r.authorId == query.userId) .OrderBy(r => r.CreateDateTime, OrderByType.Desc) .Select((r, c, cu, b) => new VueUserCommReply { bookCode = b.Code, bookName = b.Title, resCode = c.refCode, bookCoverUrl = b.CoverUrl, commentId = c.Id, commentAuthorId = c.authorId, commentAuthor = cu.NickName, pCommentDateTime = c.CreateDateTime, commentContent = c.content, replyId = r.Id, replyContent = r.content, replyTarget = r.replyName, pReplyDateTime = r.CreateDateTime, }); RefAsync <int> totalNumber = new RefAsync <int>(); result.datas = await mainSql.ToPageListAsync(query.pageIndex, query.pageSize, totalNumber); result.totalCount = totalNumber; return(result); }
public ModelPager <VueUserCommReply> queryUserCommReply(QUserCommReply query) { if (string.IsNullOrEmpty(query.userId)) { throw new Exception("非法操作!"); } return(_commentReplyResRepository.queryUserCommReply(query).Result); }
public ResultPager <VueUserCommReply> UserCommentReply(QUserCommReply query) { ResultPager <VueUserCommReply> result = new ResultPager <VueUserCommReply>(); try { result.PageData = _commentServices.queryUserCommReply(query); } catch (Exception ex) { result.ErrorMsg = ex.Message; } return(result); }