From cd7a9275aabe125b92a1548c7921a8820163105c Mon Sep 17 00:00:00 2001 From: Leufolium Date: Fri, 29 Mar 2024 23:07:36 +0800 Subject: [PATCH] by Robin at 20240329 --- app/mix/dao/mongo.go | 4 ++-- app/mix/service/logic/moment_audit_task.go | 2 +- app/mix/service/service.go | 8 ++++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/mix/dao/mongo.go b/app/mix/dao/mongo.go index 18c13217..9115c4a0 100644 --- a/app/mix/dao/mongo.go +++ b/app/mix/dao/mongo.go @@ -3320,7 +3320,7 @@ func (m *Mongo) UpdateMomentAuditTaskByTextAuditTaskIds(ctx *gin.Context, moment return err } -func (m *Mongo) UpdateMomentAuditTaskByMomentIdsAndStatus(ctx *gin.Context, moment_audit_task *dbstruct.MomentAuditTask, momentIds []int64, status int64) error { +func (m *Mongo) UpdateMomentAuditTaskByMomentIdsAndStatus(ctx *gin.Context, moment_audit_task *dbstruct.MomentAuditTask, momentIds []string, status int64) error { col := m.getColMomentAuditTask() set := util.EntityToM(moment_audit_task) set["ut"] = time.Now().Unix() @@ -3331,7 +3331,7 @@ func (m *Mongo) UpdateMomentAuditTaskByMomentIdsAndStatus(ctx *gin.Context, mome "associative_table_id": qmgo.M{ "$in": momentIds, }, - "status": status, + "manually_review_status": status, } _, err := col.UpdateAll(ctx, filter, up) return err diff --git a/app/mix/service/logic/moment_audit_task.go b/app/mix/service/logic/moment_audit_task.go index c8d378bf..55e59cc2 100644 --- a/app/mix/service/logic/moment_audit_task.go +++ b/app/mix/service/logic/moment_audit_task.go @@ -92,7 +92,7 @@ func (p *MomentAuditTask) OpUpdateByTextAuditTaskIds(ctx *gin.Context, moment_au return nil } -func (p *MomentAuditTask) OpUpdateByMomentIdsAndStatus(ctx *gin.Context, moment_audit_task *dbstruct.MomentAuditTask, momentIds []int64, status int64) error { +func (p *MomentAuditTask) OpUpdateByMomentIdsAndStatus(ctx *gin.Context, moment_audit_task *dbstruct.MomentAuditTask, momentIds []string, status int64) error { err := p.store.UpdateMomentAuditTaskByMomentIdsAndStatus(ctx, moment_audit_task, momentIds, status) if err != nil { logger.Error("UpdateMomentAuditTaskByMomentIdAndStatus fail, err: %v", err) diff --git a/app/mix/service/service.go b/app/mix/service/service.go index 75626f39..f3956738 100644 --- a/app/mix/service/service.go +++ b/app/mix/service/service.go @@ -1384,10 +1384,14 @@ func (s *Service) OpReviewMoment(ctx *gin.Context, req *momentproto.OpReviewReq) } // 更新动态审核表的状态 + momentStrIds := make([]string, 0) + for _, id := range req.MomentIds { + momentStrIds = append(momentStrIds, fmt.Sprint(id)) + } err = _DefaultMomentAuditTask.OpUpdateByMomentIdsAndStatus(ctx, &dbstruct.MomentAuditTask{ - Status: goproto.Int64(finalMomentAuditTaskStatus), + ManuallyReviewStatus: goproto.Int64(finalMomentAuditTaskStatus), ManuallyReviewOperator: goproto.Int64(req.BaseRequest.Mid), - }, req.MomentIds, consts.MomentManuallyReview_Waiting) + }, momentStrIds, consts.MomentManuallyReview_Waiting) if err != nil { logger.Error("_DefaultMomentAuditTask OpUpdateByMomentIdsAndStatus fail, req: %v, err: %v", util.ToJson(req), err) ec = errcode.ErrCodeMomentSrvFail