Merge pull request 'by Robin at 20240411' (#271) from dev-feat-IRONFANS-70-Robin into feat-IRONFANS-70

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/271
This commit is contained in:
chenhao 2024-04-11 20:18:11 +08:00
commit 9ea427b2c0
2 changed files with 3 additions and 5 deletions

View File

@ -2323,10 +2323,9 @@ func (s *Service) ApiUpdateZoneMoment(ctx *gin.Context, req *zonemomentproto.Api
// 回退空间内统计总数
if isReauditRequired {
id := util.DerefInt64(req.ZoneMoment.Id)
mediaCountInc := len(zonemoment.MediaComp.GetImageIds())
videoCountInc := len(zonemoment.MediaComp.GetVideoIds())
err := _DefaultZone.RecordStatisticsById(ctx, id, -1, -int64(mediaCountInc), -int64(videoCountInc))
err := _DefaultZone.RecordStatisticsById(ctx, util.DerefInt64(zonemoment.Zid), -1, -int64(mediaCountInc), -int64(videoCountInc))
if err != nil {
logger.Error("RecordStatisticsById fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeZoneSrvFail

View File

@ -3295,10 +3295,9 @@ func (s *Service) OpDeleteZoneMoment(ctx *gin.Context, req *zonemomentproto.OpDe
}
// 回退空间内统计总数
id := util.DerefInt64(req.Id)
mediaCountInc := len(zonemoment.MediaComp.GetImageIds())
videoCountInc := len(zonemoment.MediaComp.GetVideoIds())
err = _DefaultZone.RecordStatisticsById(ctx, id, -1, -int64(mediaCountInc), -int64(videoCountInc))
err = _DefaultZone.RecordStatisticsById(ctx, util.DerefInt64(zonemoment.Zid), -1, -int64(mediaCountInc), -int64(videoCountInc))
if err != nil {
logger.Error("RecordStatisticsById fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeZoneSrvFail
@ -3387,7 +3386,7 @@ func (s *Service) OpReviewZoneMoment(ctx *gin.Context, req *zonemomentproto.OpRe
}
mediaCountInc := len(zonemoment.MediaComp.GetImageIds())
videoCountInc := len(zonemoment.MediaComp.GetVideoIds())
err = _DefaultZone.RecordStatisticsById(ctx, id, 1, int64(mediaCountInc), int64(videoCountInc))
err = _DefaultZone.RecordStatisticsById(ctx, util.DerefInt64(zonemoment.Zid), 1, int64(mediaCountInc), int64(videoCountInc))
if err != nil {
logger.Error("RecordStatisticsById fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeZoneSrvFail