|
@@ -117,14 +117,16 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
|
|
// industry = append(industry, "no")
|
|
// industry = append(industry, "no")
|
|
// }
|
|
// }
|
|
// -------差价计算部分可注释-----
|
|
// -------差价计算部分可注释-----
|
|
- areas := qutil.ObjToMap(this.GetString("areas")) //已购买区域
|
|
|
|
- industrys := strings.Split(this.GetString("industryarr"), ",") //已购买行业
|
|
|
|
|
|
+ // areas := qutil.ObjToMap(this.GetString("areas")) //已购买区域
|
|
|
|
+ // industrys := strings.Split(this.GetString("industryarr"), ",") //已购买行业
|
|
allBuyArea := qutil.ObjToMap(this.GetString("allBuyArea")) //已购+新增区域
|
|
allBuyArea := qutil.ObjToMap(this.GetString("allBuyArea")) //已购+新增区域
|
|
allIndustry := strings.Split(this.GetString("allIndustry"), ",") //已购+新增行业
|
|
allIndustry := strings.Split(this.GetString("allIndustry"), ",") //已购+新增行业
|
|
date := this.GetString("time") //不延长时为空,正常为 年或月
|
|
date := this.GetString("time") //不延长时为空,正常为 年或月
|
|
payWay := this.GetString("payWay") //支付方式
|
|
payWay := this.GetString("payWay") //支付方式
|
|
pay_source := this.GetString("pay_source") //类型 续费-Renew or 升级-Upgrade
|
|
pay_source := this.GetString("pay_source") //类型 续费-Renew or 升级-Upgrade
|
|
addCount := this.GetString("addCount")
|
|
addCount := this.GetString("addCount")
|
|
|
|
+ oldBuyset := qutil.ObjToMap(this.GetString("oldbuyset"))
|
|
|
|
+ log.Println("111", oldBuyset)
|
|
buyset := qutil.ObjToMap(this.GetString("buyset"))
|
|
buyset := qutil.ObjToMap(this.GetString("buyset"))
|
|
log.Println("111", buyset)
|
|
log.Println("111", buyset)
|
|
var vipBuyCount *map[string]interface{}
|
|
var vipBuyCount *map[string]interface{}
|
|
@@ -144,9 +146,9 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
|
|
industry = []string{}
|
|
industry = []string{}
|
|
}
|
|
}
|
|
// }
|
|
// }
|
|
- if len(industrys) == 1 && industrys[0] == "" { //去掉[""]
|
|
|
|
- industrys = []string{}
|
|
|
|
- }
|
|
|
|
|
|
+ // if len(industrys) == 1 && industrys[0] == "" { //去掉[""]
|
|
|
|
+ // industrys = []string{}
|
|
|
|
+ // }
|
|
if len(allIndustry) == 1 && allIndustry[0] == "" { //去掉[""]
|
|
if len(allIndustry) == 1 && allIndustry[0] == "" { //去掉[""]
|
|
allIndustry = []string{}
|
|
allIndustry = []string{}
|
|
}
|
|
}
|
|
@@ -221,7 +223,8 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
|
|
//计算价格
|
|
//计算价格
|
|
var totalfee int
|
|
var totalfee int
|
|
if pay_source == "Renew" {
|
|
if pay_source == "Renew" {
|
|
- totalfee = entity.JyVipSubStruct.GetSubVipPrice(area, industry, date_count, date_unit)
|
|
|
|
|
|
+ // totalfee = entity.JyVipSubStruct.GetSubVipPrice(area, industry, date_count, date_unit)
|
|
|
|
+ totalfee = entity.JyVipSubStruct.GetSubVipBuysetPrice(buyset, date_count, date_unit)
|
|
} else if pay_source == "Upgrade" {
|
|
} else if pay_source == "Upgrade" {
|
|
upgradeYear, upgradeMonth := MaxUpgradeMonth(end) //获取最大升级月数
|
|
upgradeYear, upgradeMonth := MaxUpgradeMonth(end) //获取最大升级月数
|
|
// -------差价计算可注释-----
|
|
// -------差价计算可注释-----
|
|
@@ -272,8 +275,10 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
|
|
// totalfee = addAreaY + addAreaM + oldAreaY + oldAreaM + addIndustryY + addIndustryM
|
|
// totalfee = addAreaY + addAreaM + oldAreaY + oldAreaM + addIndustryY + addIndustryM
|
|
// --------升级价格交叉计算--------
|
|
// --------升级价格交叉计算--------
|
|
// --------升级价格差价计算--------
|
|
// --------升级价格差价计算--------
|
|
- oldPriceY := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeYear, 1)
|
|
|
|
- oldPriceM := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeMonth, 2)
|
|
|
|
|
|
+ // oldPriceY := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeYear, 1)
|
|
|
|
+ // oldPriceM := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeMonth, 2)
|
|
|
|
+ oldPriceY := entity.JyVipSubStruct.GetSubVipBuysetPrice(oldBuyset, upgradeYear, 1)
|
|
|
|
+ oldPriceM := entity.JyVipSubStruct.GetSubVipBuysetPrice(oldBuyset, upgradeMonth, 2)
|
|
oldPrice := oldPriceY + oldPriceM
|
|
oldPrice := oldPriceY + oldPriceM
|
|
// newPriceY := entity.JyVipSubStruct.GetSubVipPrice(allBuyArea, allIndustry, upgradeYear, 1)
|
|
// newPriceY := entity.JyVipSubStruct.GetSubVipPrice(allBuyArea, allIndustry, upgradeYear, 1)
|
|
// newPriceM := entity.JyVipSubStruct.GetSubVipPrice(allBuyArea, allIndustry, upgradeMonth, 2)
|
|
// newPriceM := entity.JyVipSubStruct.GetSubVipPrice(allBuyArea, allIndustry, upgradeMonth, 2)
|
|
@@ -292,7 +297,13 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
log.Println("price", totalfee)
|
|
log.Println("price", totalfee)
|
|
- // totalfee = 1
|
|
|
|
|
|
+ paymoneny := float64(totalfee) * 0.0000001
|
|
|
|
+ if paymoneny < 1 {
|
|
|
|
+ if totalfee != 0 {
|
|
|
|
+ totalfee = 1
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ log.Println("price", totalfee)
|
|
|
|
|
|
//创建订单
|
|
//创建订单
|
|
tradeno, prepayid, payStr := "", "", ""
|
|
tradeno, prepayid, payStr := "", "", ""
|