|
@@ -348,15 +348,20 @@ func (this *vipSubscribeStruct) UpgradeSubVip(userId string, vmsg VipSimpleMsg,
|
|
|
|
|
|
//超级订阅获取购买项
|
|
|
func (this *vipSubscribeStruct) NewBuySet(area *map[string]interface{}, industry []string, isUpgrade bool) *SubvipBuySet {
|
|
|
- if area != nil && (*area)["全国"] != nil {
|
|
|
- area = &map[string]interface{}{}
|
|
|
+ pCount := -1
|
|
|
+ citys := []int{}
|
|
|
+ if area != nil {
|
|
|
+ if (*area)["全国"] != nil {
|
|
|
+ area = &map[string]interface{}{}
|
|
|
+ } else if pCount_tmp := qutil.IntAll((*area)["areacount"]); pCount_tmp > 0 {
|
|
|
+ pCount = pCount_tmp
|
|
|
+ }
|
|
|
}
|
|
|
buyset := SubvipBuySet{}
|
|
|
if !isUpgrade {
|
|
|
buyset.Upgrade = 0 //升级版超级订阅标识
|
|
|
if len(*area) > 0 {
|
|
|
- pCount := 0
|
|
|
- citys := []int{}
|
|
|
+ pCount = 0
|
|
|
for _, v := range *area {
|
|
|
tmp := v.([]interface{})
|
|
|
if len(tmp) == 0 || len(tmp) > SubVipPrice.Old.CityMaxCount { //省份
|
|
@@ -370,12 +375,9 @@ func (this *vipSubscribeStruct) NewBuySet(area *map[string]interface{}, industry
|
|
|
pCount = -1
|
|
|
citys = []int{}
|
|
|
}
|
|
|
- buyset.NewCitys = citys //城市
|
|
|
- buyset.AreaCount = pCount //地区
|
|
|
- } else {
|
|
|
- buyset.AreaCount = -1 //全国
|
|
|
- buyset.NewCitys = []int{}
|
|
|
}
|
|
|
+ buyset.NewCitys = citys
|
|
|
+ buyset.AreaCount = pCount //地区
|
|
|
//行业数量自动转换全行业
|
|
|
buyset.BuyerclassCount = len(industry)
|
|
|
if len(industry) > SubVipPrice.Old.BuyerClassMaxCount || len(industry) == 0 {
|
|
@@ -389,15 +391,13 @@ func (this *vipSubscribeStruct) NewBuySet(area *map[string]interface{}, industry
|
|
|
if pCount > SubVipPrice.New.ProvinceMaxCount {
|
|
|
pCount = -1
|
|
|
}
|
|
|
- buyset.NewCitys = []int{} //城市,4.4改版不支持购买城市
|
|
|
- buyset.AreaCount = pCount //地区
|
|
|
} else {
|
|
|
buyset.AreaCount = -1 //全国
|
|
|
- buyset.NewCitys = []int{}
|
|
|
}
|
|
|
+ buyset.AreaCount = pCount //地区
|
|
|
+ buyset.NewCitys = citys //城市,4.4改版不支持购买城市
|
|
|
buyset.BuyerclassCount = -1 //行业,4.4改版只能购买全行业
|
|
|
}
|
|
|
-
|
|
|
return &buyset
|
|
|
}
|
|
|
|
|
@@ -563,10 +563,15 @@ func (this *vipSubscribeStruct) GetSubVipPriceByBuySet(buySet *SubvipBuySet, cou
|
|
|
if pCount == -1 {
|
|
|
pCount = 0
|
|
|
}
|
|
|
- //当选择月份大于 按照全年计算
|
|
|
- if count > SubVipPrice.New.MonthMaxCount && unit == 2 { //月份十个月以上价格一样
|
|
|
- unit = 1
|
|
|
- count = 1
|
|
|
+ if pCount != 0 { //购买省份计算 省份10个月价格和11个月价格一样
|
|
|
+ if count > SubVipPrice.New.MonthMaxCount && unit == 2 {
|
|
|
+ count = 10
|
|
|
+ }
|
|
|
+ } else { //购买全国计算 全国10个月价格和11个月价格不一样 多9元为了个商机版价格保持一致
|
|
|
+ if count > SubVipPrice.New.MonthMaxCount && unit == 2 {
|
|
|
+ unit = 1
|
|
|
+ count = 1
|
|
|
+ }
|
|
|
}
|
|
|
return getSetMealPrice(pCount, unit) * count //全国1行业套餐
|
|
|
}
|