Browse Source

error

master
黄梓健 5 years ago
parent
commit
c97a9189a9
  1. 9
      services/pay/handle.go

9
services/pay/handle.go

@ -15,7 +15,7 @@ import (
func init() {
//go loopOrder()
go utils.HandleTicker(1*time.Hour, HandleReward) // 打赏24小时退款
go utils.HandleTicker(1*time.Second, HandleReward) // 打赏24小时退款
}
var orderDelayQueue = make(chan *models.UserOrder, math.MaxInt8)
@ -247,7 +247,7 @@ func HandleTimeout(order *models.UserOrder) error {
func HandleReward() error {
result, err := models.GetExpireRewardHistory()
if err != nil {
logger.Error("获取过期打赏错误原因", err)
err = fmt.Errorf("获取过期打赏错误原因: %v", err)
return err
}
for _, v := range result {
@ -256,13 +256,14 @@ func HandleReward() error {
}
_, err := Refund("欧轩互动-打赏过期退款", v.OutTradeNo)
if err != nil {
logger.Error("欧轩互动打赏过期退款", v.OutTradeNo)
err = fmt.Errorf("欧轩互动打赏过期退款错误: %v, out_trade_no: %v", err, v.OutTradeNo)
return err
}
v.Status = 4
_, err = models.Update(v.Id, v, "status")
if err != nil {
logger.Error("欧轩互动打赏过期状态改变错误")
err = fmt.Errorf("欧轩互动打赏过期状态改变错误: %v, out_trade_no: %v", err, v.OutTradeNo)
return err
}
}
return nil

Loading…
Cancel
Save