Merge pull request 'by Robin at 20240329' (#221) from feat-IRONFANS-76-Robin into test

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/221
This commit is contained in:
chenhao 2024-03-29 23:08:24 +08:00
commit 266c9818f3
3 changed files with 9 additions and 5 deletions

View File

@ -3318,7 +3318,7 @@ func (m *Mongo) UpdateMomentAuditTaskByTextAuditTaskIds(ctx *gin.Context, moment
return err 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() col := m.getColMomentAuditTask()
set := util.EntityToM(moment_audit_task) set := util.EntityToM(moment_audit_task)
set["ut"] = time.Now().Unix() set["ut"] = time.Now().Unix()
@ -3329,7 +3329,7 @@ func (m *Mongo) UpdateMomentAuditTaskByMomentIdsAndStatus(ctx *gin.Context, mome
"associative_table_id": qmgo.M{ "associative_table_id": qmgo.M{
"$in": momentIds, "$in": momentIds,
}, },
"status": status, "manually_review_status": status,
} }
_, err := col.UpdateAll(ctx, filter, up) _, err := col.UpdateAll(ctx, filter, up)
return err return err

View File

@ -92,7 +92,7 @@ func (p *MomentAuditTask) OpUpdateByTextAuditTaskIds(ctx *gin.Context, moment_au
return nil 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) err := p.store.UpdateMomentAuditTaskByMomentIdsAndStatus(ctx, moment_audit_task, momentIds, status)
if err != nil { if err != nil {
logger.Error("UpdateMomentAuditTaskByMomentIdAndStatus fail, err: %v", err) logger.Error("UpdateMomentAuditTaskByMomentIdAndStatus fail, err: %v", err)

View File

@ -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{ err = _DefaultMomentAuditTask.OpUpdateByMomentIdsAndStatus(ctx, &dbstruct.MomentAuditTask{
Status: goproto.Int64(finalMomentAuditTaskStatus), ManuallyReviewStatus: goproto.Int64(finalMomentAuditTaskStatus),
ManuallyReviewOperator: goproto.Int64(req.BaseRequest.Mid), ManuallyReviewOperator: goproto.Int64(req.BaseRequest.Mid),
}, req.MomentIds, consts.MomentManuallyReview_Waiting) }, momentStrIds, consts.MomentManuallyReview_Waiting)
if err != nil { if err != nil {
logger.Error("_DefaultMomentAuditTask OpUpdateByMomentIdsAndStatus fail, req: %v, err: %v", util.ToJson(req), err) logger.Error("_DefaultMomentAuditTask OpUpdateByMomentIdsAndStatus fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeMomentSrvFail ec = errcode.ErrCodeMomentSrvFail