From 739fe8b27fccc592628ecc945033bf699c3e56bd Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Mon, 1 May 2023 14:10:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=B6=E6=97=8F=E6=8E=92=E8=A1=8C=E5=A5=96?= =?UTF-8?q?=E5=8A=B1bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/service/group_power_s/group_power.go | 9 +++++---- test/group_power_test.go | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/domain/service/group_power_s/group_power.go b/domain/service/group_power_s/group_power.go index 9e4bcd3..83e1783 100644 --- a/domain/service/group_power_s/group_power.go +++ b/domain/service/group_power_s/group_power.go @@ -16,11 +16,11 @@ import ( "hilo-group/domain/cache/user_c" "hilo-group/domain/event/group_power_ev" "hilo-group/domain/model/groupPower_m" - "time" "hilo-group/domain/model/msg_m" "hilo-group/domain/model/noble_m" "hilo-group/domain/model/user_m" "hilo-group/myerr/bizerr" + "time" ) type GroupPowerService struct { @@ -193,11 +193,12 @@ func CalcGroupPowerMonthRankAct(model *domain.Model) error { lastDayTime := time.Now().AddDate(0, 0, -1) _now := now.New(lastDayTime) calcMonth := _now.BeginningOfMonth().Format(utils.MONTH_FORMAT) + starDate := _now.BeginningOfMonth().Format(utils.COMPACT_MONTH_FORMAT) beginDate, endDate := _now.BeginningOfMonth().Format("2006-01-02"), _now.EndOfMonth().Format("2006-01-02") - return DoCalcGroupPowerMonthRankAct(model, calcMonth, beginDate, endDate) + return DoCalcGroupPowerMonthRankAct(model, calcMonth, beginDate, endDate, starDate) } -func DoCalcGroupPowerMonthRankAct(model *domain.Model, calcMonth, beginDate, endDate string) error { +func DoCalcGroupPowerMonthRankAct(model *domain.Model, calcMonth, beginDate, endDate, starDate string) error { areaList := []int{1, 2} for _, area := range areaList { // 计算获奖 model := domain.CreateModelContext(model.MyContext) @@ -208,7 +209,7 @@ func DoCalcGroupPowerMonthRankAct(model *domain.Model, calcMonth, beginDate, end powerIds := make([]uint64, 0, len(response.Items)) for i, v := range response.Items { powerIds = append(powerIds, v.Id) - response.Items[i].StarList, err = GetGroupPowerStar(model, v.Id, groupPower_e.GroupPowerStarTypeFamous, 0, 10, time.Now().Format(utils.COMPACT_MONTH_FORMAT)) + response.Items[i].StarList, err = GetGroupPowerStar(model, v.Id, groupPower_e.GroupPowerStarTypeFamous, 0, 10, starDate) if err != nil { return err } diff --git a/test/group_power_test.go b/test/group_power_test.go index a659a3a..0d84707 100644 --- a/test/group_power_test.go +++ b/test/group_power_test.go @@ -38,5 +38,5 @@ func TestDoCalcGroupPowerMonthRankAct(t *testing.T) { _now := now.New(lastDayTime) calcMonth := _now.BeginningOfMonth().Format(utils.MONTH_FORMAT) beginDate, endDate := _now.BeginningOfMonth().Format("2006-01-02"), _now.EndOfMonth().Format("2006-01-02") - _ = group_power_s.DoCalcGroupPowerMonthRankAct(domain.CreateModelNil(), calcMonth, beginDate, endDate) + _ = group_power_s.DoCalcGroupPowerMonthRankAct(domain.CreateModelNil(), calcMonth, beginDate, endDate, "") } -- 2.22.0