Parcourir la source

update 一个圈圈

master
DengBiao il y a 11 mois
Parent
révision
fc47d361e9
1 fichiers modifiés avec 10 ajouts et 1 suppressions
  1. +10
    -1
      rule/one_circles/one_circles_public_platoon_give_activty_coin.go

+ 10
- 1
rule/one_circles/one_circles_public_platoon_give_activty_coin.go Voir le fichier

@@ -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
}


Chargement…
Annuler
Enregistrer