zhangxinlei1996 3 years ago
parent
commit
def6168a0d

+ 1 - 1
src/jfw/modules/publicapply/src/subscribe/entity/entity.go

@@ -126,8 +126,8 @@ func (pi *ParamInfo) GetSubMsg() UserSubMsg {
 		o_jy, _ := (*mData)["o_jy"].(map[string]interface{})
 		o_jy, _ := (*mData)["o_jy"].(map[string]interface{})
 		if o_jy["o_area"] != nil {
 		if o_jy["o_area"] != nil {
 			res.Area, _ = o_jy["o_area"].(map[string]interface{})
 			res.Area, _ = o_jy["o_area"].(map[string]interface{})
-			res.Infotype, _ = o_jy["a_infotype"].([]interface{})
 		}
 		}
+		res.Infotype, _ = o_jy["a_infotype"].([]interface{})
 		//地区调整可用次数
 		//地区调整可用次数
 		pnum := redis.GetInt(jy.PowerCacheDb, fmt.Sprintf(jy.UserUpdateAreaKey, pi.UserId))
 		pnum := redis.GetInt(jy.PowerCacheDb, fmt.Sprintf(jy.UserUpdateAreaKey, pi.UserId))
 		res.Areanum = qutil.If(pnum > 0, jy.BaseAreaNum-pnum, jy.BaseAreaNum).(int)
 		res.Areanum = qutil.If(pnum > 0, jy.BaseAreaNum-pnum, jy.BaseAreaNum).(int)

+ 20 - 19
src/jfw/modules/subscribepay/src/service/areaPack.go

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