From dfe854a236f7f49b481a16e5ff65cafb7499d6e2 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 19 Apr 2022 16:15:41 +0800 Subject: [PATCH] workMoments --- internal/rpc/office/office.go | 1 + pkg/common/db/mongoModel.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index db5da07b7..4cf783194 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -464,6 +464,7 @@ func (s *officeServer) GetUserWorkMomentsCommentsMsg(_ context.Context, req *pbO resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} return resp, nil } + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "workMomentsCommentMsgs: ", workMomentsCommentMsgs) for _, commentMsg := range workMomentsCommentMsgs { comment := pbOffice.Comment{} if err := utils.CopyStructFields(&comment, commentMsg); err != nil { diff --git a/pkg/common/db/mongoModel.go b/pkg/common/db/mongoModel.go index 18406df36..2a9de60d3 100644 --- a/pkg/common/db/mongoModel.go +++ b/pkg/common/db/mongoModel.go @@ -668,7 +668,7 @@ func (d *DataBases) GetUserWorkMomentsCommentsMsg(userID string, showNumber, pag c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cCommentMsg) var commentMsgList []CommentMsg findOpts := options.Find().SetLimit(int64(showNumber)).SetSkip(int64(showNumber) * (int64(pageNumber) - 1)).SetSort(bson.M{"create_time": -1}) - result, err := c.Find(ctx, bson.M{"user_id": userID}, findOpts) + result, err := c.Find(ctx, bson.M{"comment.user_id": userID}, findOpts) if err != nil { return commentMsgList, err }