diff --git a/rule/one_circles/one_circles_public_platoon_give_activty_coin.go b/rule/one_circles/one_circles_public_platoon_give_activty_coin.go index 7cbd586..fb75210 100644 --- a/rule/one_circles/one_circles_public_platoon_give_activty_coin.go +++ b/rule/one_circles/one_circles_public_platoon_give_activty_coin.go @@ -6,6 +6,7 @@ import ( "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/md" md2 "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/rule/one_circles/md" zhios_order_relate_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils" + "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils/cache" zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils/logx" "encoding/json" "errors" @@ -168,12 +169,20 @@ func SettlementPublicGiveActivityCoin(engine *xorm.Engine, masterId string, uid return err } } - err = session.Commit() if err != nil { _ = session.Rollback() return errors.New("事务提交失败") } + + 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") + } else { + nextWatchAdDate = time.Now().Add(time.Duration(zhios_order_relate_utils.StrToInt64(videoRewardSystem.IntervalMinutes)) * time.Minute).Format("2006-01-02 15:04:05") + } + cache.SetEx(redisKey, nextWatchAdDate, 60*2) //TODO::默认缓存1小时 } return }