Browse Source

优惠券被占用

zhangxinlei1996 3 years ago
parent
commit
019a1aa103

+ 2 - 0
src/jfw/modules/subscribepay/src/service/areaPack.go

@@ -89,6 +89,8 @@ func (this *AreaPack) CreateOrder() {
 						discount_price = totalfee - totalfee*disCount_int/1000
 						totalfee = totalfee * disCount_int / 1000
 					}
+				} else {
+					userLotteryId = ""
 				}
 			}
 		}

+ 2 - 0
src/jfw/modules/subscribepay/src/service/dataExportPay.go

@@ -166,6 +166,8 @@ func (p *DataExportPay) CreateOrder() {
 					discount_price = order_money - order_money*disCount_int/1000
 					order_money = order_money * disCount_int / 1000
 				}
+			} else {
+				userLotteryId = ""
 			}
 		}
 		log.Println(userLotteryId, "--discount_price:", discount_price)

+ 2 - 2
src/jfw/modules/subscribepay/src/service/dataexportPack.go

@@ -132,10 +132,8 @@ func (this *DataExportPack) CreateOrder() {
 			fullPrice, reducePrice, discount, userLotteryId = util.GetCouponInfo(userId, lotteryId, products)
 			if fullPrice <= orderMoney {
 				if discount == 100 {
-
 					orderMoney = orderMoney - reducePrice
 					discountPrice = reducePrice
-
 				} else {
 					//折扣
 					disCount_int := int(math.Ceil(discount * 100))
@@ -143,6 +141,8 @@ func (this *DataExportPack) CreateOrder() {
 					orderMoney = orderMoney * disCount_int / 1000
 				}
 				log.Printf("用户%s 购买数据流量包 使用卡券:%s 折扣金额:%d", userId, userLotteryId, discountPrice)
+			} else {
+				userLotteryId = ""
 			}
 		}
 		//赠品相关

+ 2 - 0
src/jfw/modules/subscribepay/src/service/integral.go

@@ -94,6 +94,8 @@ func (b *Integral) CreateOrder() {
 					discount_price = order_money - order_money*disCount_int/1000
 					order_money = order_money * disCount_int / 1000
 				}
+			} else {
+				userLotteryId = ""
 			}
 		}
 		log.Println(userLotteryId, "--discount_price:", discount_price)

+ 2 - 0
src/jfw/modules/subscribepay/src/service/vipSubscribeChange.go

@@ -245,6 +245,8 @@ func (this *SubscribeChange) Upgrade() {
 					discount_price = final_price - final_price*disCount_int/1000
 					final_price = final_price * disCount_int / 1000
 				}
+			} else {
+				userLotteryId = ""
 			}
 		}
 		//测试打折

+ 4 - 0
src/jfw/modules/subscribepay/src/service/vipSubscribePay.go

@@ -188,6 +188,8 @@ func (this *SubVipPayOrder) CreateOrder() {
 					discount_price = totalfee - totalfee*disCount_int/1000
 					totalfee = totalfee * disCount_int / 1000
 				}
+			} else {
+				userLotteryId = ""
 			}
 		}
 		//赠品相关
@@ -402,6 +404,8 @@ func (this *SubVipPayOrder) Renew() {
 					discount_price = totalfee - totalfee*disCount_int/1000
 					totalfee = totalfee * disCount_int / 1000
 				}
+			} else {
+				userLotteryId = ""
 			}
 		}
 		filterStr, _ := json.Marshal(filter)