|
|
@@ -68,7 +68,6 @@ func OrderCancelAutomatically() {
|
|
|
Password: beego.AppConfig.String("AliRedisPwd"), //默认空密码
|
|
|
DB: db, //使用默认数据库
|
|
|
})
|
|
|
- beego.BeeLogger.Info("Connect redis name (%s), pwd=%s", beego.AppConfig.String("AliRedisHost"), beego.AppConfig.String("AliRedisPwd"))
|
|
|
defer client.Close() //最后关闭
|
|
|
key := helpers.GetOrderCancelList()
|
|
|
list, _ := client.LRange(key, -1000, -1).Result()
|
|
|
@@ -79,6 +78,10 @@ func OrderCancelAutomatically() {
|
|
|
helpers.ThrowOutRedisList(key, orderId)
|
|
|
continue
|
|
|
}
|
|
|
+ beego.BeeLogger.Info("payTime=%d", payTime)
|
|
|
+ beego.BeeLogger.Info("time.Now().Unix()=%d", time.Now().Unix())
|
|
|
+ beego.BeeLogger.Info("order.CreatedAt.Unix()=%d", order.CreatedAt.Unix())
|
|
|
+
|
|
|
//如果下单时间超过一天,则取消订单
|
|
|
if order.Status == order_model.STATUS_UNPAY && order.CreatedAt.Unix()+int64(payTime) < time.Now().Unix() {
|
|
|
if order.CouponPrice > 0 {
|