|
@@ -203,25 +203,27 @@ function getUpgradeFinalStatus(newBuyset, oldBuyset, t, endUnix, renewList) {
|
|
|
if (t.length === 0) {
|
|
|
return [-1, false, false] //订阅修改
|
|
|
}
|
|
|
- var renewPrice = getsubVipOrderPriceBybuyset(oldBuyset, t)//续费
|
|
|
+ var renewPrice = getsubVipOrderPriceBybuyset(oldBuyset, t);//续费
|
|
|
return [renewPrice, false, false]
|
|
|
}
|
|
|
var final_price = 0;
|
|
|
var nowEndTime = endUnix;
|
|
|
//续费升级价格
|
|
|
- for (var i = renewList.length - 1; i >= 0; i--) {
|
|
|
- var thisBuyset = renewList[i].o_buyset;
|
|
|
- var thisStartTime = renewList[i].l_validtime;
|
|
|
- var this_price = getSubPrice({
|
|
|
- "areacount": thisBuyset.areacount, //省份数量
|
|
|
- "buyerclasscount": thisBuyset.buyerclasscount,
|
|
|
- "citys": thisBuyset.newcitys //购买省份中城市数量
|
|
|
- }, Upgrade, thisStartTime, nowEndTime);
|
|
|
- if (this_price < 0) {
|
|
|
- return [-2, false, false]
|
|
|
+ if (renewList.length > 0) {
|
|
|
+ for (var i = renewList.length - 1; i >= 0; i--) {
|
|
|
+ var thisBuyset = renewList[i].o_buyset;
|
|
|
+ var thisStartTime = renewList[i].l_validtime;
|
|
|
+ var this_price = getSubPrice({
|
|
|
+ "areacount": thisBuyset.areacount, //省份数量
|
|
|
+ "buyerclasscount": thisBuyset.buyerclasscount,
|
|
|
+ "citys": thisBuyset.newcitys //购买省份中城市数量
|
|
|
+ }, Upgrade, thisStartTime, nowEndTime);
|
|
|
+ if (this_price < 0) {
|
|
|
+ return [-2, false, false]
|
|
|
+ }
|
|
|
+ final_price += this_price;
|
|
|
+ nowEndTime = thisStartTime;
|
|
|
}
|
|
|
- final_price += this_price;
|
|
|
- nowEndTime = thisStartTime;
|
|
|
}
|
|
|
//现在使用升级价格
|
|
|
var now_price = getSubPrice(oldBuyset, Upgrade, new Date().getTime() / 1000, nowEndTime);
|