xuzhiheng 5 年之前
父節點
當前提交
32470d93b0

+ 29 - 15
src/jfw/modules/pushsubscribe/src/push/util/util.go

@@ -154,15 +154,7 @@ func SaveToPushsubscribe(isVipUser, isProjectInfo bool, userId string, matchInfo
 	}
 	unix := time.Now().Unix()
 	length := len(*matchInfos)
-	fields := []string{"userid", "infoid", "date", "matchkeys", "area", "city"}
-	if isVipUser {
-		fields = append(fields, "buyerclass")
-		if isProjectInfo {
-			fields = append(fields, "type")
-		}
-	} else {
-		fields = append(fields, "subscopeclass")
-	}
+	fields := []string{"userid", "infoid", "date", "matchkeys", "area", "city", "buyerclass", "type", "isvip"}
 	var savecount int64
 	i := length
 	for {
@@ -171,14 +163,36 @@ func SaveToPushsubscribe(isVipUser, isProjectInfo bool, userId string, matchInfo
 		for i > 0 {
 			i--
 			matchInfo := (*matchInfos)[i]
-			values = append(values, userId, util.ObjToString((*matchInfo.Info)["_id"]), unix, strings.Join(matchInfo.Keys, " "), util.ObjToString((*matchInfo.Info)["area"]), util.ObjToString((*matchInfo.Info)["city"]))
+			values = append(values, userId, util.ObjToString((*matchInfo.Info)["_id"]), unix)
+			if len(matchInfo.Keys) > 0 {
+				values = append(values, strings.Join(matchInfo.Keys, " "))
+			} else {
+				values = append(values, nil)
+			}
+			if area := util.ObjToString((*matchInfo.Info)["area"]); area != "" {
+				values = append(values, area)
+			} else {
+				values = append(values, nil)
+			}
+			if city := util.ObjToString((*matchInfo.Info)["city"]); city != "" {
+				values = append(values, city)
+			} else {
+				values = append(values, nil)
+			}
+			if buyerclass := util.ObjToString((*matchInfo.Info)["buyerclass"]); buyerclass != "" {
+				values = append(values, buyerclass)
+			} else {
+				values = append(values, nil)
+			}
+			if isProjectInfo {
+				values = append(values, 1)
+			} else {
+				values = append(values, nil)
+			}
 			if isVipUser {
-				values = append(values, util.ObjToString((*matchInfo.Info)["buyerclass"]))
-				if isProjectInfo {
-					values = append(values, 1)
-				}
+				values = append(values, 1)
 			} else {
-				values = append(values, GetSubScopeClass((*matchInfo.Info)["s_subscopeclass"]))
+				values = append(values, nil)
 			}
 			batchSize++
 			if batchSize == BigBulkSize {

+ 8 - 2
src/jfw/modules/weixin/src/config.json

@@ -72,7 +72,7 @@
         "description": ""
     },
     "2017policy": "2017年招投标政策法规大盘点下载:https://share.weiyun.com/66b98209cefd61860fd32b9416ed52d9",
-    "activesign": true,
+    "activesign": false,
     "activeArr": [
         {
             "keysReplay": false,
@@ -89,5 +89,11 @@
             "activeEnd": 1586185600,
             "subSecondRP": "https://www.jianyu360.com/images/t3.jpg"
         }
-    ]
+    ],
+	"preheatingState":true,
+	"preheatingReply": {
+        "href_vip":"/front/vipsubscribe/toSetPage",
+        "href_notvip":"/front/vipsubscribe/introducePage",
+        "content":"<a href='%s'>剑鱼标讯VIP订阅新上线</a>"
+	}
 }

+ 16 - 0
src/jfw/modules/weixin/src/wx/wx.go

@@ -789,6 +789,22 @@ func Subscribe(w ResponseWriter, r *Request) {
 			PicUrl:      subscribeReply["picUrl"].(string),
 			Description: subscribeReply["description"].(string),
 		}})
+		//vip消息
+		preheatingState := config.Sysconfig["preheatingState"].(bool)
+		if preheatingState {
+			preheatingReply := config.Sysconfig["preheatingReply"].(map[string]interface{})
+			u, ok := tools.MQFW.FindOne("user", `{"s_m_openid":"`+openid+`"}`)
+			if len(*u) > 0 && ok {
+				if util.Int64All((*u)["i_vip_status"]) == 1 || util.Int64All((*u)["i_vip_status"]) == 2 {
+					preheatingReply["href"] = preheatingReply["href_vip"]
+				} else {
+					preheatingReply["href"] = preheatingReply["href_notvip"]
+				}
+			}
+			time.AfterFunc(time.Second/2, func() {
+				w.PostText(fmt.Sprintf(fmt.Sprint(preheatingReply["content"]), config.Sysconfig["webdomain"].(string)+preheatingReply["href"].(string)))
+			})
+		}
 	}
 	if source != "" && len(source) > 5 {
 		go saveUserLog(source, openid, activeName, shareflag)

+ 0 - 2
src/web/templates/weixin/vipsubscribe/vip_purchase.html

@@ -655,8 +655,6 @@
                 }
                 if (!isChecked) {
                     $('#number_box_month button').attr('disabled', true)
-                } else {
-                    $('#number_box_month button').removeAttr('disabled')
                 }
                 //let result = (Number(val) * 5.8).toFixed(1);
                 //$('.computed_price').html('¥' + result);