|
@@ -63,25 +63,6 @@ func (this *AreaPack) CreateOrder() {
|
|
lotteryId := this.GetString("lotteryId")
|
|
lotteryId := this.GetString("lotteryId")
|
|
discount_price, userLotteryId := 0, ""
|
|
discount_price, userLotteryId := 0, ""
|
|
useProduct, _ := this.GetInteger("useProduct")
|
|
useProduct, _ := this.GetInteger("useProduct")
|
|
- if lotteryId != "" {
|
|
|
|
- products := config.CouponConfig.Products[filter.ProductId()]
|
|
|
|
- if useProduct > 0 {
|
|
|
|
- products = strconv.Itoa(useProduct)
|
|
|
|
- }
|
|
|
|
- full_price, reduce_price := 0, 0
|
|
|
|
- var discount float64
|
|
|
|
- full_price, reduce_price, discount, userLotteryId = util.GetCouponInfo(userId, lotteryId, products)
|
|
|
|
- if discount == 100 { //满减
|
|
|
|
- if full_price <= totalfee {
|
|
|
|
- totalfee = totalfee - reduce_price
|
|
|
|
- discount_price = reduce_price
|
|
|
|
- }
|
|
|
|
- } else { //满折
|
|
|
|
- disCount_int := int(math.Ceil(discount * 100))
|
|
|
|
- discount_price = totalfee - totalfee*disCount_int/1000
|
|
|
|
- totalfee = totalfee * disCount_int / 1000
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
//赠品相关
|
|
//赠品相关
|
|
discountId, _ := this.GetInteger("discountId")
|
|
discountId, _ := this.GetInteger("discountId")
|
|
if discountId > 0 {
|
|
if discountId > 0 {
|
|
@@ -90,6 +71,26 @@ func (this *AreaPack) CreateOrder() {
|
|
filter.GiveCycle = timeNum
|
|
filter.GiveCycle = timeNum
|
|
filter.GiveType = timeType
|
|
filter.GiveType = timeType
|
|
filter.DisCountId = discountId
|
|
filter.DisCountId = discountId
|
|
|
|
+ } else {
|
|
|
|
+ if lotteryId != "" {
|
|
|
|
+ products := config.CouponConfig.Products[filter.ProductId()]
|
|
|
|
+ if useProduct > 0 {
|
|
|
|
+ products = strconv.Itoa(useProduct)
|
|
|
|
+ }
|
|
|
|
+ full_price, reduce_price := 0, 0
|
|
|
|
+ var discount float64
|
|
|
|
+ full_price, reduce_price, discount, userLotteryId = util.GetCouponInfo(userId, lotteryId, products)
|
|
|
|
+ if discount == 100 { //满减
|
|
|
|
+ if full_price <= totalfee {
|
|
|
|
+ totalfee = totalfee - reduce_price
|
|
|
|
+ discount_price = reduce_price
|
|
|
|
+ }
|
|
|
|
+ } else { //满折
|
|
|
|
+ disCount_int := int(math.Ceil(discount * 100))
|
|
|
|
+ discount_price = totalfee - totalfee*disCount_int/1000
|
|
|
|
+ totalfee = totalfee * disCount_int / 1000
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
//
|
|
//
|
|
if totalfee <= 0 {
|
|
if totalfee <= 0 {
|