Bläddra i källkod

promotion add nums* cent and cash if is more

abiao 5 år sedan
förälder
incheckning
e1f04f2ece
1 ändrade filer med 4 tillägg och 2 borttagningar
  1. 4 2
      go/gopath/src/fohow.com/apps/helpers/promotion_helper.go

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

@@ -122,14 +122,16 @@ func SetOrderPromotion(orderId string, wxUid int64) {
 			}
 			//赠送积分 or 代办费
 			if item.Cash > 0 {
+				totalCash := nums * item.Cash
 				source := balance_model.BALANCE_SOURCE_PROMOTION
 				remark := fmt.Sprintf("促销赠送提货券")
-				new(balance_model.Balance).Create(order.WxUserId, order.UserId, item.Cash, source, order.OrderId, remark)
+				new(balance_model.Balance).Create(order.WxUserId, order.UserId, totalCash, source, order.OrderId, remark)
 			}
 			if item.Cent > 0 {
+				totalCent := nums * item.Cent
 				source := cent_model.PROMOTION_SEND
 				remark := fmt.Sprintf("促销活动赠送")
-				new(cent_model.CentBalance).Create(order.WxUserId, item.Cent, source, order.OrderId, remark)
+				new(cent_model.CentBalance).Create(order.WxUserId, totalCent, source, order.OrderId, remark)
 			}
 		}
 	}