group_power_month_act.go 912 Bytes
Newer Older
chenweijian's avatar
chenweijian committed
1 2 3 4
package group_cron

import (
	"git.hilo.cn/hilo-common/domain"
chenweijian's avatar
chenweijian committed
5
	"git.hilo.cn/hilo-common/resource/config"
chenweijian's avatar
chenweijian committed
6 7 8 9 10 11
	"github.com/robfig/cron"
	"hilo-group/domain/service/group_power_s"
)

// 家族贡献月度排行榜发奖
func GroupPowerMonthRankAct() {
chenweijian's avatar
chenweijian committed
12 13 14
	if !config.IsMaster() {
		return
	}
chenweijian's avatar
chenweijian committed
15 16 17 18 19 20 21 22 23 24 25 26
	c := cron.New()
	// 每月1号0:01结算发奖
	spec := "0 1 0 1 * ?"
	_ = c.AddFunc(spec, func() {
		var model = domain.CreateModelNil()
		if err := group_power_s.CalcGroupPowerMonthRankAct(model); err != nil {
			model.Log.Errorf("GroupPowerMonthRankAct fail:%v", err)
		}
	})

	c.Start()
}
chenweijian's avatar
chenweijian committed
27

chenweijian's avatar
chenweijian committed
28 29 30 31 32 33 34 35 36 37 38 39
//func BufaGroupPowerMonthRankAct() {
//	c := cron.New()
//	spec := "0 50 15 1 * ?"
//	_ = c.AddFunc(spec, func() {
//		var model = domain.CreateModelNil()
//		if err := group_power_s.BufaCalcGroupPowerMonthRankAct(model); err != nil {
//			model.Log.Errorf("BufaGroupPowerMonthRankAct fail:%v", err)
//		}
//	})
//
//	c.Start()
//}