abiao лет назад: 5
Родитель
Сommit
51bbf76d58
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      go/gopath/src/fohow.com/apps/helpers/promotion_helper.go

+ 3 - 2
go/gopath/src/fohow.com/apps/helpers/promotion_helper.go

@@ -10,8 +10,7 @@ import (
 //发放促销商品
 func SetOrderPromotion(orderId string, wxUid int64) {
 	beego.BeeLogger.Warn("******* SetOrderPromotion orderId:%s wxUid:%d", orderId, wxUid)
-	firstFlag := true
-	totalFlag := true
+
 	firstOrder := false
 	//获取订单明细
 	order := order_model.GetOrderById(orderId, false)
@@ -28,6 +27,8 @@ func SetOrderPromotion(orderId string, wxUid int64) {
 	// 获取所有有效促销记录
 	effectivePromotions := order_model.GetEffetivePromotions(queryDate, order.OrderType, false)
 	for _, item := range effectivePromotions {
+		firstFlag := true
+		totalFlag := true
 		if item.MaxTotal > 0 && order.TotalPrice > item.MaxTotal {
 			totalFlag = false
 			continue