|
|
@@ -2,7 +2,7 @@ package cron_controller
|
|
|
|
|
|
import (
|
|
|
"fmt"
|
|
|
- "fohow.com/apps/helpers"
|
|
|
+ "fohow.com/libs/lib_redis"
|
|
|
"github.com/go-redis/redis"
|
|
|
"time"
|
|
|
|
|
|
@@ -69,18 +69,18 @@ func OrderCancelAutomatically() {
|
|
|
DB: db, //使用默认数据库
|
|
|
})
|
|
|
defer client.Close() //最后关闭
|
|
|
- key := helpers.GetOrderCancelList()
|
|
|
+ key := lib_redis.GetOrderCancelList()
|
|
|
list, _ := client.LRange(key, -1000, -1).Result()
|
|
|
for _, orderId := range list {
|
|
|
beego.BeeLogger.Info("orderId=%s", orderId)
|
|
|
|
|
|
order := order_model.GetOrderById(orderId)
|
|
|
if order == nil {
|
|
|
- helpers.ThrowOutRedisList(key, orderId)
|
|
|
+ lib_redis.ThrowOutRedisList(key, orderId)
|
|
|
continue
|
|
|
}
|
|
|
if order.PaiedAt > 0 {
|
|
|
- helpers.ThrowOutRedisList(key, orderId)
|
|
|
+ lib_redis.ThrowOutRedisList(key, orderId)
|
|
|
continue
|
|
|
}
|
|
|
beego.BeeLogger.Info("payTime=%d", payTime)
|
|
|
@@ -97,10 +97,10 @@ func OrderCancelAutomatically() {
|
|
|
}
|
|
|
order.Status = order_model.STATUS_CLOSED
|
|
|
order.Save()
|
|
|
- helpers.ThrowOutRedisList(key, orderId)
|
|
|
+ lib_redis.ThrowOutRedisList(key, orderId)
|
|
|
}
|
|
|
if order.Status == order_model.STATUS_CLOSED {
|
|
|
- helpers.ThrowOutRedisList(key, orderId)
|
|
|
+ lib_redis.ThrowOutRedisList(key, orderId)
|
|
|
}
|
|
|
}
|
|
|
return
|