|
@@ -159,23 +159,15 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
|
|
|
if pay_source == "Renew" {
|
|
|
totalfee = entity.JyVipSubStruct.GetSubVipPrice(area, industry, date_count, date_unit)
|
|
|
} else if pay_source == "Upgrade" {
|
|
|
- log.Println("areas", areas)
|
|
|
- log.Println("industrys", industrys)
|
|
|
- upgradeYear, upgradeMonth := MaxUpgradeMonth(end, effect) //获取最大升级月数
|
|
|
- log.Println("upgradeYear", upgradeYear)
|
|
|
- log.Println("upgradeMonth", upgradeMonth)
|
|
|
- addY := entity.JyVipSubStruct.GetSubVipPrice(area, industry, upgradeYear, 1) //已购+新增,以年为单位的价格
|
|
|
- addM := entity.JyVipSubStruct.GetSubVipPrice(area, industry, upgradeMonth, 2) //已购+新增,以月为单位的价格
|
|
|
- log.Println("addY", addY)
|
|
|
- log.Println("addM", addM)
|
|
|
+ upgradeYear, upgradeMonth := MaxUpgradeMonth(end, effect) //获取最大升级月数
|
|
|
+ addY := entity.JyVipSubStruct.GetSubVipPrice(area, industry, upgradeYear, 1) //已购+新增,以年为单位的价格
|
|
|
+ addM := entity.JyVipSubStruct.GetSubVipPrice(area, industry, upgradeMonth, 2) //已购+新增,以月为单位的价格
|
|
|
addPrice := addM + addY //已购+新增总价格
|
|
|
nowY := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeYear, 1) //已购,以年为单位的价格
|
|
|
nowM := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeMonth, 2) //已购,以月为单位的价格
|
|
|
- log.Println("nowY", nowY)
|
|
|
- log.Println("nowM", nowM)
|
|
|
- nowPrice := nowM + nowY //已购总价格
|
|
|
- totalfee = addPrice - nowPrice //已购+新增的总价格 - 已购总价格 = 升级差价
|
|
|
- if date_unit == 1 { //升级中的延长时间
|
|
|
+ nowPrice := nowM + nowY //已购总价格
|
|
|
+ totalfee = addPrice - nowPrice //已购+新增的总价格 - 已购总价格 = 升级差价
|
|
|
+ if date_unit == 1 { //升级中的延长时间
|
|
|
lengPrice := entity.JyVipSubStruct.GetSubVipPrice(area, industry, date_count, 1) //单位为年的已购+新增延长时间价格
|
|
|
totalfee = totalfee + lengPrice //已购+新增延长时间价格 + 升级差价 = 最终价格
|
|
|
} else if date_unit == 2 {
|