From 9a5968f158f89bed73b677cce5a5b952561b1ab9 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Sat, 27 Apr 2024 00:39:28 +0800 Subject: [PATCH] by Robin at 20240427 --- app/mix/service/apiservice.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/mix/service/apiservice.go b/app/mix/service/apiservice.go index 423c32cb..316418e5 100644 --- a/app/mix/service/apiservice.go +++ b/app/mix/service/apiservice.go @@ -2645,6 +2645,16 @@ func (s *Service) ApiDeleteZoneMoment(ctx *gin.Context, req *zonemomentproto.Api } } + // 回退空间内统计总数 + mediaCountInc := len(zonemoment.MediaComp.GetImageIds()) + videoCountInc := len(zonemoment.MediaComp.GetVideoIds()) + err = _DefaultZone.RecordStatisticsById(ctx, zonemoment.GetZid(), -1, -int64(mediaCountInc), -int64(videoCountInc)) + if err != nil { + logger.Error("RecordStatisticsById fail, req: %v, err: %v", util.ToJson(req), err) + ec = errcode.ErrCodeZoneSrvFail + return + } + // 回退每日发帖次数 totalIncr := int64(-1) _, err = _DefaultZoneMomentCreateTimes.OpGetAndUpdate(ctx, zone.GetMid(), totalIncr)