From 5eeebd4206a117e958b7c39e03607cb5192c0256 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Mon, 29 Jul 2024 13:15:11 +0800 Subject: [PATCH] by Robin at 20240729 --- app/mix/service/service.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/mix/service/service.go b/app/mix/service/service.go index 97361b59..fb18fc30 100644 --- a/app/mix/service/service.go +++ b/app/mix/service/service.go @@ -1462,12 +1462,18 @@ func (s *Service) OpReviewMoment(ctx *gin.Context, req *momentproto.OpReviewReq) return } - // 更新动态的状态 - err := _DefaultMoment.OpUpdateByIdsAndStatus(ctx, &momentproto.OpUpdateReq{ + // 更新请求,如果是通过,则恢复删除标志 + updateReq := &momentproto.OpUpdateReq{ Moment: &dbstruct.Moment{ Status: goproto.Int64(finalMomentStatus), }, - }, req.MomentIds, consts.Moment_ManuallyReviewing) + } + if req.OpType == consts.MomentManuallyReview_Pass { + updateReq.Moment.DelFlag = goproto.Int64(consts.Exist) + } + + // 更新动态的状态 + err := _DefaultMoment.OpUpdateByIdsAndStatus(ctx, updateReq, req.MomentIds, consts.Moment_ManuallyReviewing) if err != nil { logger.Error("_DefaultMoment OpUpdateByIds fail, req: %v, err: %v", util.ToJson(req), err) ec = errcode.ErrCodeMomentSrvFail