소스 검색

Merge branch 'dev4.5' of http://192.168.3.207:8080/qmx/jy into dev4.5

zhangyuhan 4 년 전
부모
커밋
f86d7edfea

+ 7 - 6
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_upgrade.js

@@ -586,12 +586,13 @@ $(function () {
       if (r.success) {
         try {
           clearSessionStorage()
-          // if (param.price == 0) {
-          //   window.location.replace("/jyapp/vipsubscribe/toOrderDetailPage?orderCode=" + r.data.code)
-          //   return
-          // }
-          history.replaceState({}, '', '/jyapp/vipsubscribe/toOrderDetailPage?orderCode=' + r.data.code);
-          window.location.href = "/jyapp/pay/checkout_subvip?orderCode=" + r.data.code + "&t=2&from=buy"
+          if (r.data.needPay) {
+            history.replaceState({}, '', '/jyapp/vipsubscribe/toOrderDetailPage?orderCode=' + r.data.code);
+            window.location.href = "/jyapp/pay/checkout_subvip?orderCode=" + r.data.code + "&t=2&from=buy"
+          } else {
+            // 0元订单提交
+            window.location.replace("/jyapp/subvip/paySuccess?orderCode=" + r.data.code + '&t=2');
+          }
         } catch (e) {
           showToast(e)
         }

+ 25 - 15
src/jfw/modules/publicapply/src/enterpriseSearch/entity/entQuery.go

@@ -13,10 +13,10 @@ type EnterpriseSearch struct {
 	MatchType   string //搜索范围[A:企业名称,B:法定代表人,C:股东,D:高管,E:项目or标的物]
 	EntArea     string //注册地省份[多个用逗号分割]
 	EntCity     string //注册地城市[多个用逗号分割]
-	EntCapital  string //注册资本[min-max,必有-]
-	EntType     string //企业类型[A:有限责任公司,B:股份有限公司,C:有限合伙,D:普通合伙]
-	EntStatus   string //企业状态[A:存续,B:吊销,C:注销、D:(停业??)、E:撤销]
-	BiddingArea string //中标地区[会员:多个用逗号分割]
+	EntCapital  string //注册资本[min-max,必有-][多个用逗号分割]
+	EntType     string //企业类型[A:有限责任公司,B:股份有限公司,C:有限合伙,D:普通合伙][多个用逗号分割]
+	EntStatus   string //企业状态[A:存续,B:吊销,C:注销、D:(停业??)、E:撤销][多个用逗号分割]
+	BiddingArea string //中标地区
 	EntClass    string //单位类型[会员:1:采购单位、2:投标企业、3:代理机构、4:厂商]
 	EntContact  string //联系方式[会员:1:固定电话、2:手机号、3:邮箱、4:不存在]
 
@@ -139,19 +139,29 @@ func (es *EnterpriseSearch) GetQuerySql() string {
 
 	//注册资本
 	if es.EntCapital != "" {
-		moneyRange := strings.Split(es.EntCapital, "-")
-		limit, max, moneyQuery := qutil.Int64All(moneyRange[0]), qutil.Int64All(moneyRange[1]), ""
-		if limit > 0 {
-			moneyQuery = fmt.Sprintf(`"from": "%d"`, qutil.Int64All(limit))
-		}
-		if max > 0 {
-			if moneyQuery != `` {
-				moneyQuery += ","
+		thisQuery := []string{}
+		for _, moneyRanges := range strings.Split(es.EntCapital, ",") {
+			if moneyRanges == "" || strings.Index(moneyRanges, "-") < 0 {
+				continue
+			}
+			moneyRange := strings.Split(moneyRanges, "-")
+			limit, max, moneyQuery := qutil.Int64All(moneyRange[0]), qutil.Int64All(moneyRange[1]), ""
+			if limit > 0 {
+				moneyQuery = fmt.Sprintf(`"from": "%d"`, qutil.Int64All(limit))
+			}
+			if max > 0 {
+				if moneyQuery != `` {
+					moneyQuery += ","
+				}
+				moneyQuery += fmt.Sprintf(`"to": "%d"`, qutil.Int64All(max))
+			}
+			if moneyQuery != "" {
+				thisQuery = append(thisQuery, fmt.Sprintf(`{"range": {"capital": {%s}}}`, moneyQuery))
 			}
-			moneyQuery += fmt.Sprintf(`"to": "%d"`, qutil.Int64All(max))
 		}
-		if moneyQuery != "" {
-			musts = append(musts, fmt.Sprintf(`{"range": {"capital": {%s}}}`, moneyQuery))
+
+		if len(thisQuery) > 0 {
+			musts = append(musts, fmt.Sprintf(`{"bool":{"should":[%s],"minimum_should_match": 1}}`, strings.Join(thisQuery, ",")))
 		}
 	}
 	//企业类型(页面显示的企业与数据已存在的类型不一致)

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

@@ -166,7 +166,7 @@ func (this *SubscribeChange) Upgrade() {
 		}
 
 		filter := entity.VipSimpleMsg{
-			Industry:         nil, //行业保存默认选择
+			Industry:         []string{}, //行业保存默认选择
 			Cyclecount:       date_count,
 			Cycleunit:        date_unit,
 			OldBuyset:        oldBuyset,
@@ -194,6 +194,15 @@ func (this *SubscribeChange) Upgrade() {
 			log.Println(userId+" 前台计算", req_price, "后台计算", final_price)
 			return &entity.FuncResult{false, errors.New(fmt.Sprintf("金额校验异常[%d,%d]", final_price, req_price)), nil}
 		}
+		order_status := 0
+		//老用户 0元升级
+		if req_price == 0 && 0 == final_price {
+			if oldBuyset.Upgrade == 0 {
+				order_status = 1
+			} else {
+				return &entity.FuncResult{false, errors.New("超级订阅升级异常"), nil}
+			}
+		}
 		//卡卷使用
 		userLotteryId, lotteryId := "", this.GetString("lotteryId")
 		full_price, reduce_price := 0, 0
@@ -234,7 +243,7 @@ func (this *SubscribeChange) Upgrade() {
 		}
 		insertMap := map[string]interface{}{
 			"order_money":    final_price,
-			"order_status":   0,
+			"order_status":   order_status,
 			"user_openid":    openId,
 			"order_code":     ordercode,
 			"product_type":   "VIP订阅",

+ 10 - 3
src/web/staticres/vipsubscribe/js/vip_renew.js

@@ -37,16 +37,23 @@ var renew = {
             result.area = '全国'
         } else {
             var strArr = []
-            if (buySet.areacount) {
+            if (buySet.upgrade == 1) {
+              if (buySet.areacount) {
+                strArr.push(buySet.areacount + '')
+              }
+            } else {
+              if (buySet.areacount) {
                 strArr.push(buySet.areacount + '个省')
-            }
-            if (buySet.newcitys && buySet.newcitys.length !== 0) {
+              }
+              if (buySet.newcitys && buySet.newcitys.length !== 0) {
                 var count = 0
                 buySet.newcitys.forEach(function (item) {
                     count += item
                 })
                 strArr.push(count + '个市(分布在' + buySet.newcitys.length + '个省内')
+              }
             }
+            
             result.area = strArr.join('、')
         }
 

+ 7 - 2
src/web/staticres/vipsubscribe/js/vip_upgrade.js

@@ -593,8 +593,13 @@ $(function () {
     $DoPost("/subscribepay/vipsubscribe/upgrade", param, function (r) {
       if (r.success) {
         clearSessionStorage();
-        history.replaceState({}, '', '/front/vipsubscribe/toOrderDetailPage?orderCode=' + r.data.code);
-        window.location.href = "/weixin/pay/checkout_subvip?t=2&orderCode=" + r.data.code;
+        if (r.data.needPay) {
+          history.replaceState({}, '', '/front/vipsubscribe/toOrderDetailPage?orderCode=' + r.data.code);
+          window.location.href = "/weixin/pay/checkout_subvip?t=2&orderCode=" + r.data.code;
+        } else {
+          // 0元订单提交
+          window.location.replace("/weixin/subvip/paySuccess?orderCode=" + r.data.code + '&t=2');
+        }
       } else {
         $('.vip-footer.renew .confirm').removeAttr("disabled");
       }