Commit 739fe8b2 authored by chenweijian's avatar chenweijian

家族排行奖励bug

parent 8c06f31f
......@@ -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
}
......
......@@ -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, "")
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment