Commit ff26e264 authored by chenweijian's avatar chenweijian

cp补偿分数

parent 49350b91
......@@ -2,6 +2,7 @@ package event_s
import (
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/resource/config"
"git.hilo.cn/hilo-common/resource/redisCli"
"github.com/jinzhu/now"
"hilo-user/_const/enum/cp_e"
......@@ -76,8 +77,11 @@ func CpGiftEvent() {
// 送礼增加cp等级
// 送礼增加cp排行榜
func CompensateCpScore() {
if !config.IsMaster() {
return
}
model := domain.CreateModelNil()
num, err := redisCli.IncrNumExpire("scirpt:CompensateCpScore", 1, time.Hour*999)
num, err := redisCli.IncrNumExpire("scirpt:compensateCpScore", 1, time.Hour*999)
if err != nil {
model.Log.Errorf("CompensateCpScore err:%v", err)
}
......@@ -98,8 +102,11 @@ func CompensateCpScore() {
CreatedTime time.Time `json:"created_time"`
}
rows := make([]*GiftOperate, 0)
err = model.DB().Model(GiftOperate{}).Where("res_gift_id in (?)",
[]int{3561, 3571, 3581, 3591, 3601, 3611, 3621, 3631, 3641, 3651, 3661, 3671, 3681, 3691, 3701, 3711}).Where("created_time < ?", "2023-06-22 11:20:15").Find(&rows).Error
err = model.DB().Model(GiftOperate{}).
Where("created_time < ?", "2023-06-22 11:20:15").
Where("res_gift_id in (?)",
[]int{3561, 3571, 3581, 3591, 3601, 3611, 3621, 3631, 3641, 3651, 3661, 3671, 3681, 3691, 3701, 3711}).
Find(&rows).Error
if err != nil {
model.Log.Errorf("CompensateCpScore err:%v", err)
return
......
......@@ -16,6 +16,7 @@ func EventInit() {
UserBagSendEvent()
CpGiftEvent()
CpSpaceVisitEvent()
CompensateCpScore()
}
func UserBagSendEvent() {
......
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