Browse Source

update 一个圈圈

master
DengBiao 10 months ago
parent
commit
527c11f075
1 changed files with 14 additions and 7 deletions
  1. +14
    -7
      rule/one_circles/one_circles_public_platoon_give_activty_coin.go

+ 14
- 7
rule/one_circles/one_circles_public_platoon_give_activty_coin.go View File

@@ -126,10 +126,12 @@ func SettlementPublicGiveActivityCoin(engine *xorm.Engine, masterId string, uid
} else {
residueWatchAdNum := oneCirclesUserWatchRecords.ResidueWatchAdNum - 1
nextWatchAdDate := oneCirclesUserWatchRecords.NextWatchAdDate
if residueWatchAdNum == 0 {
nextWatchAdDate = now.Add(time.Hour * time.Duration(zhios_order_relate_utils.StrToInt(videoRewardSystem.EachRoundHour)))
if residueWatchAdNum == 0 { //最后一条广告
residueWatchAdNum = zhios_order_relate_utils.StrToInt(videoRewardSystem.RewardTotalNum)
}
if residueWatchAdNum == zhios_order_relate_utils.StrToInt(videoRewardSystem.RewardTotalNum)-1 { //第一条广告
nextWatchAdDate = now.Add(time.Hour * time.Duration(zhios_order_relate_utils.StrToInt(videoRewardSystem.EachRoundHour)))
}
oneCirclesUserWatchRecords.ResidueWatchAdNum = residueWatchAdNum
oneCirclesUserWatchRecords.NextWatchAdDate = nextWatchAdDate
_, err2 := db.OneCirclesUserWatchRecordsUpdate(engine, oneCirclesUserWatchRecords.Id, oneCirclesUserWatchRecords, "residue_watch_ad_num", "next_watch_ad_date")
@@ -189,13 +191,18 @@ func SettlementPublicGiveActivityCoin(engine *xorm.Engine, masterId string, uid
}

redisKey := fmt.Sprintf(md2.UserNextWatchAdDate, masterId, uid)
var nextWatchAdDate string
if oneCirclesUserWatchRecords.NextWatchAdDate.After(time.Now()) {
nextWatchAdDate = oneCirclesUserWatchRecords.NextWatchAdDate.Format("2006-01-02 15:04:05")
var watchAdDate string
if oneCirclesUserWatchRecords.ResidueWatchAdNum == zhios_order_relate_utils.StrToInt(videoRewardSystem.RewardTotalNum) {
if oneCirclesUserWatchRecords.NextWatchAdDate.Before(time.Now()) {
watchAdDate = ""
} else {
watchAdDate = oneCirclesUserWatchRecords.NextWatchAdDate.Format("2006-01-02 15:04:05")
}
} else {
nextWatchAdDate = time.Now().Add(time.Duration(zhios_order_relate_utils.StrToInt64(videoRewardSystem.IntervalMinutes)) * time.Minute).Format("2006-01-02 15:04:05")
watchAdDate = time.Now().Add(time.Duration(zhios_order_relate_utils.StrToInt64(videoRewardSystem.IntervalMinutes)) * time.Minute).Format("2006-01-02 15:04:05")
//watchAdDate = oneCirclesUserWatchRecords.NextWatchAdDate.Format("2006-01-02 15:04:05")
}
cache.SetEx(redisKey, nextWatchAdDate, 60*2) //TODO::默认缓存1小时
cache.SetEx(redisKey, watchAdDate, 60*60*12) //TODO::默认缓存1小时
}
return
}


Loading…
Cancel
Save