Parcourir la source

add promotion

abiao il y a 5 ans
Parent
commit
d7ffab0744

+ 6 - 6
go/gopath/src/fohow.com/apps/controllers/cron_controller/order_receive_automatically.go

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

+ 2 - 4
go/gopath/src/fohow.com/apps/controllers/order_controller/order_controller.go

@@ -2,9 +2,7 @@ package order_controller
 
 import (
 	"fmt"
-	"fohow.com/apps/helpers"
 	"fohow.com/libs/lib_redis"
-
 	// "fmt"
 	"strconv"
 	// "time"
@@ -424,8 +422,8 @@ func (self *OrderController) Operate() {
 	//先处理退单
 	if operate == order_model.OPERATE_CANCEL && o.Status == order_model.STATUS_UNPAY {
 		//已支付订单移除未支付队列
-		cancelKey := helpers.GetOrderCancelList()
-		helpers.ThrowOutRedisList(cancelKey, o.OrderId)
+		cancelKey := lib_redis.GetOrderCancelList()
+		lib_redis.ThrowOutRedisList(cancelKey, o.OrderId)
 		if o.CouponPrice > 0 {
 			//退款至代金券账户
 			source := balance_model.BALANCE_SOURCE_ALL_REFUNDED_NAME

+ 3 - 3
go/gopath/src/fohow.com/apps/controllers/pay_controller/after_pay_controller.go

@@ -7,7 +7,7 @@ import (
 	// "github.com/astaxie/beego"
 
 	"fohow.com/apps"
-	"fohow.com/apps/helpers"
+	"fohow.com/libs/lib_redis"
 	"math"
 
 	// "fohow.com/apps/models/balance_model"
@@ -368,8 +368,8 @@ func (self *PayController) wxPayExchangeAsync() {
 		go order_model.SendCreate(order.OrderId, order.Id, productId, product.Price, product.Price, product.Name, int64(1))
 	}
 	//已支付订单移除队列
-	cancelKey := helpers.GetOrderCancelList()
-	helpers.ThrowOutRedisList(cancelKey, order.OrderId)
+	cancelKey := lib_redis.GetOrderCancelList()
+	lib_redis.ThrowOutRedisList(cancelKey, order.OrderId)
 	//更新商品售量
 	go UpdatePdSaleNums(order)
 	notifyResponse["return_code"] = wx_mp.PAY_SUCCESS

+ 4 - 2
go/gopath/src/fohow.com/apps/controllers/pay_controller/pay_exchange_controller.go

@@ -2,6 +2,8 @@ package pay_controller
 
 import (
 	"fmt"
+	"fohow.com/libs/lib_redis"
+
 	// "net/url"
 	// "strings"
 	"time"
@@ -159,8 +161,8 @@ func (self *PayController) payExchange(oId, payWay, tradPwd, returnUrl, source s
 				go order_model.SendCreate(order.OrderId, order.Id, productId, product.Price, product.Price, product.Name, int64(1))
 			}
 			//已支付订单移除未支付队列
-			cancelKey := helpers.GetOrderCancelList()
-			helpers.ThrowOutRedisList(cancelKey, order.OrderId)
+			cancelKey := lib_redis.GetOrderCancelList()
+			lib_redis.ThrowOutRedisList(cancelKey, order.OrderId)
 			//更新已售数量
 			go order_model.UpdateSaleNums(SaleNumsMap)
 			//go CreateOrderNotify(order, product)