From fc47d361e9bc149fa778f1c92d1b4597a26e1346 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Fri, 2 Feb 2024 19:39:35 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=B8=80=E4=B8=AA=E5=9C=88=E5=9C=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../one_circles_public_platoon_give_activty_coin.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 }