Commit 97beeb3a authored by chenweijian's avatar chenweijian

家族贡献排行自动发奖

parent fbf01a1e
...@@ -189,6 +189,10 @@ func CalcGroupPowerMonthRankAct(model *domain.Model) error { ...@@ -189,6 +189,10 @@ func CalcGroupPowerMonthRankAct(model *domain.Model) error {
_now := now.New(lastDayTime) _now := now.New(lastDayTime)
calcMonth := _now.BeginningOfMonth().Format(utils.MONTH_FORMAT) calcMonth := _now.BeginningOfMonth().Format(utils.MONTH_FORMAT)
beginDate, endDate := _now.BeginningOfMonth().Format("2006-01-02"), _now.EndOfMonth().Format("2006-01-02") beginDate, endDate := _now.BeginningOfMonth().Format("2006-01-02"), _now.EndOfMonth().Format("2006-01-02")
return DoCalcGroupPowerMonthRankAct(model, calcMonth, beginDate, endDate)
}
func DoCalcGroupPowerMonthRankAct(model *domain.Model, calcMonth, beginDate, endDate string) error {
// 计算获奖 // 计算获奖
response, err := GetGroupPowerRankResp(model, beginDate, endDate, 0) response, err := GetGroupPowerRankResp(model, beginDate, endDate, 0)
if err != nil { if err != nil {
......
...@@ -3,9 +3,13 @@ package test ...@@ -3,9 +3,13 @@ package test
import ( import (
"fmt" "fmt"
"git.hilo.cn/hilo-common/domain" "git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/utils"
"github.com/jinzhu/now"
"hilo-group/domain/model/groupPower_m" "hilo-group/domain/model/groupPower_m"
"hilo-group/domain/model/group_m" "hilo-group/domain/model/group_m"
"hilo-group/domain/service/group_power_s"
"testing" "testing"
"time"
) )
func TestGetAllGroupPowerOwner(t *testing.T) { func TestGetAllGroupPowerOwner(t *testing.T) {
...@@ -23,3 +27,11 @@ func TestIsUseTRTC(t *testing.T) { ...@@ -23,3 +27,11 @@ func TestIsUseTRTC(t *testing.T) {
fmt.Println("true--------------") fmt.Println("true--------------")
} }
} }
func TestDoCalcGroupPowerMonthRankAct(t *testing.T) {
lastDayTime := time.Now().AddDate(0, 0, -1)
_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)
}
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