|
@@ -6,6 +6,7 @@ import ( |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/md" |
|
|
"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" |
|
|
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" |
|
|
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" |
|
|
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils/logx" |
|
|
"encoding/json" |
|
|
"encoding/json" |
|
|
"errors" |
|
|
"errors" |
|
@@ -168,12 +169,20 @@ func SettlementPublicGiveActivityCoin(engine *xorm.Engine, masterId string, uid |
|
|
return err |
|
|
return err |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
err = session.Commit() |
|
|
err = session.Commit() |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
_ = session.Rollback() |
|
|
_ = session.Rollback() |
|
|
return errors.New("事务提交失败") |
|
|
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 |
|
|
return |
|
|
} |
|
|
} |
|
|