|
@@ -68,14 +68,14 @@ func (this *RenewUpgrade) GetBuyMsg() {
|
|
//升级续费
|
|
//升级续费
|
|
//创建订单返回支付串
|
|
//创建订单返回支付串
|
|
func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
|
|
func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
|
|
- area := qutil.ObjToMap(this.GetString("area")) //已购买区域+新增区域
|
|
|
|
- industry := strings.Split(this.GetString("industry"), ",") //已购买行业+新增行业
|
|
|
|
- areas := qutil.ObjToMap(this.GetString("areas")) //已购买区域
|
|
|
|
- industrys := strings.Split(this.GetString("industrys"), ",") //已购买行业
|
|
|
|
- date := this.GetString("time") //不延长时为空,正常为 年或月
|
|
|
|
- payWay := this.GetString("payWay") //支付方式
|
|
|
|
- effect := this.GetString("effect") //升级 生效日期 立即生效-now 下月一号生效-下月一号的时间戳
|
|
|
|
- pay_source := this.GetString("pay_source") //类型 续费-Renew or 升级-Upgrade
|
|
|
|
|
|
+ area := qutil.ObjToMap(this.GetString("area")) //已购买区域+新增区域
|
|
|
|
+ industry := strings.Split(this.GetString("industry"), ",") //已购买行业+新增行业
|
|
|
|
+ areas := qutil.ObjToMap(this.GetString("areas")) //已购买区域
|
|
|
|
+ industrys := strings.Split(this.GetString("industryarr"), ",") //已购买行业
|
|
|
|
+ date := this.GetString("time") //不延长时为空,正常为 年或月
|
|
|
|
+ payWay := this.GetString("payWay") //支付方式
|
|
|
|
+ effect := this.GetString("effect") //升级 生效日期 立即生效-now 下月一号生效-下月一号的时间戳
|
|
|
|
+ pay_source := this.GetString("pay_source") //类型 续费-Renew or 升级-Upgrade
|
|
userId := qutil.ObjToString(this.GetSession("userId"))
|
|
userId := qutil.ObjToString(this.GetSession("userId"))
|
|
openId := qutil.ObjToString(this.GetSession("s_m_openid"))
|
|
openId := qutil.ObjToString(this.GetSession("s_m_openid"))
|
|
r := func() *entity.FuncResult {
|
|
r := func() *entity.FuncResult {
|
|
@@ -133,6 +133,7 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
|
|
// endTime = endTime.AddDate(0, date_count, 0)
|
|
// endTime = endTime.AddDate(0, date_count, 0)
|
|
// }
|
|
// }
|
|
endTime = util.GetDATE(date_unit, date_count, end)
|
|
endTime = util.GetDATE(date_unit, date_count, end)
|
|
|
|
+ log.Println("endend", endTime)
|
|
if pay_source == "Renew" && now.Unix() > end { //到期后的续费从当前时间往后延长
|
|
if pay_source == "Renew" && now.Unix() > end { //到期后的续费从当前时间往后延长
|
|
startTime = now
|
|
startTime = now
|
|
// if date_unit == 1 { ///延长时间
|
|
// if date_unit == 1 { ///延长时间
|
|
@@ -158,15 +159,23 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
|
|
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)
|
|
} else if pay_source == "Upgrade" {
|
|
} else if pay_source == "Upgrade" {
|
|
- upgradeYear, upgradeMonth := MaxUpgradeMonth(end, effect) //获取最大升级月数
|
|
|
|
- addY := entity.JyVipSubStruct.GetSubVipPrice(area, industry, upgradeYear, 1) //已购+新增,以年为单位的价格
|
|
|
|
- addM := entity.JyVipSubStruct.GetSubVipPrice(area, industry, upgradeMonth, 2) //已购+新增,以月为单位的价格
|
|
|
|
|
|
+ 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)
|
|
addPrice := addM + addY //已购+新增总价格
|
|
addPrice := addM + addY //已购+新增总价格
|
|
nowY := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeYear, 1) //已购,以年为单位的价格
|
|
nowY := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeYear, 1) //已购,以年为单位的价格
|
|
nowM := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeMonth, 2) //已购,以月为单位的价格
|
|
nowM := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeMonth, 2) //已购,以月为单位的价格
|
|
- nowPrice := nowM + nowY //已购总价格
|
|
|
|
- totalfee = addPrice - nowPrice //已购+新增的总价格 - 已购总价格 = 升级差价
|
|
|
|
- if date_unit == 1 { //升级中的延长时间
|
|
|
|
|
|
+ log.Println("nowY", nowY)
|
|
|
|
+ log.Println("nowM", nowM)
|
|
|
|
+ nowPrice := nowM + nowY //已购总价格
|
|
|
|
+ totalfee = addPrice - nowPrice //已购+新增的总价格 - 已购总价格 = 升级差价
|
|
|
|
+ if date_unit == 1 { //升级中的延长时间
|
|
lengPrice := entity.JyVipSubStruct.GetSubVipPrice(area, industry, date_count, 1) //单位为年的已购+新增延长时间价格
|
|
lengPrice := entity.JyVipSubStruct.GetSubVipPrice(area, industry, date_count, 1) //单位为年的已购+新增延长时间价格
|
|
totalfee = totalfee + lengPrice //已购+新增延长时间价格 + 升级差价 = 最终价格
|
|
totalfee = totalfee + lengPrice //已购+新增延长时间价格 + 升级差价 = 最终价格
|
|
} else if date_unit == 2 {
|
|
} else if date_unit == 2 {
|