Przeglądaj źródła

Merge branch 'dev3.0active' of http://192.168.3.207:10080/qmx/jy into dev3.0active

cuiyalong 4 lat temu
rodzic
commit
7856d1680e

+ 2 - 0
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_index_new.js

@@ -875,6 +875,8 @@ $(function () {
                         });
                     }
                 }
+            }else{
+				weui.loading().hide();
             }
         }, false);
     }

+ 4 - 2
src/jfw/modules/subscribepay/src/service/vipSubscribeChange.go

@@ -416,7 +416,7 @@ func needUpgrade(newBuySet, oldBuySet *entity.SubvipBuySet) (bool, *entity.Subvi
 
 //升级详情单
 func getUpgradeDetail(userId string, newBuySet, oldBuySet *entity.SubvipBuySet, oldEndtime int64, count, unit int) (totalPrice int, subtotals []map[string]interface{}) {
-	rResult, ok := util.MQFW.Find("vip_upgrade", &bson.M{"s_userid": userId, "i_isvalid": 0}, `{"l_validtime":"1"}`, `{"o_buyset":1,"l_validtime":1}`, false, -1, -1)
+	rResult, ok := util.MQFW.Find("vip_upgrade", &bson.M{"s_userid": userId, "i_isvalid": 0}, `{"l_validtime":1}`, `{"o_buyset":1,"l_validtime":1}`, false, -1, -1)
 	if !ok {
 		return -2, nil
 	}
@@ -433,6 +433,7 @@ func getUpgradeDetail(userId string, newBuySet, oldBuySet *entity.SubvipBuySet,
 			if this_price < 0 {
 				return -1, nil
 			}
+			log.Println("---------------this_price:", this_price)
 			totalPrice += this_price
 			subtotals = append(subtotals, map[string]interface{}{
 				"type":      1,
@@ -447,6 +448,7 @@ func getUpgradeDetail(userId string, newBuySet, oldBuySet *entity.SubvipBuySet,
 	//当前升级
 	now := time.Now()
 	price_now := getSubtotalPrice(oldBuySet, newBuySet, now.Unix(), nowEndTime)
+	log.Println("~~~~~~~~2", price_now)
 	if price_now < 0 {
 		return -1, nil
 	}
@@ -462,6 +464,7 @@ func getUpgradeDetail(userId string, newBuySet, oldBuySet *entity.SubvipBuySet,
 	if count > 0 {
 		renew_price := entity.JyVipSubStruct.GetSubVipPriceByBuySet(newBuySet.NewCitys, newBuySet.AreaCount, newBuySet.BuyerclassCount, count, unit, false)
 		if renew_price < 0 {
+			log.Println("~~~~~~~~3", renew_price)
 			return -1, nil
 		}
 		totalPrice += renew_price
@@ -490,7 +493,6 @@ func getSubtotalPrice(oldBuyset, newBuyset *entity.SubvipBuySet, startTime, endt
 			newCitysBuyTwo++
 		}
 	}
-
 	if (oldBuyset.AreaCount != -1 && newBuyset.AreaCount != -1 && (oldBuyset.AreaCount > newBuyset.AreaCount || len(oldBuyset.NewCitys)+oldBuyset.AreaCount > len(newBuyset.NewCitys)+newBuyset.AreaCount || oldCitysBuyTwo+oldBuyset.AreaCount > newCitysBuyTwo+newBuyset.AreaCount)) ||
 		(oldBuyset.AreaCount == -1 && newBuyset.AreaCount != -1) || //旧套餐全国 新套餐非全国
 		(oldBuyset.BuyerclassCount != -1 && newBuyset.BuyerclassCount != -1 && oldBuyset.BuyerclassCount > newBuyset.BuyerclassCount) || //非全行业下 新套餐行业数量小于旧套餐数量