zhangxinlei1996 4 vuotta sitten
vanhempi
commit
801ab8dcfa

+ 2 - 1
src/config.json

@@ -296,5 +296,6 @@
     "pcindexCacheTime":7200,
     "pcIndexHotCacheTime":7200,
     "pcindexCacheKey":"jypcindex2",
-    "dedupUrl":  "http://127.0.0.1:8888/data/deduplication"
+    "dedupUrl":  "http://127.0.0.1:8888/data/deduplication",
+    "optimalTime":"2021-08-03 12:00:00"
 }

+ 21 - 1
src/jfw/front/wxkeyset.go

@@ -223,14 +223,34 @@ func (m *Front) WxKeysetAjaxReq() {
 			return
 		}
 		saveKey := map[string]interface{}{
-			"key":      keys,
+			"key":      []string{keys[0]},
 			"area":     fliterEmptyArr(area),
 			"notkey":   fliterEmptyArr(notkey),
 			"infotype": fliterEmptyArr(infotype),
 		}
+		var optime time.Time
+		var regtime int64
+		if rd, ok := mongodb.FindById("user", userId, `{"o_jy":1,"l_registedate":1}`); rd != nil && ok && len(*rd) > 0 {
+			//获取活动上线时间
+			optimalTime, _ := config.Sysconfig["optimalTime"].(string)
+			optime, _ = time.ParseInLocation(util.Date_Full_Layout, optimalTime, time.Local)
+			regtime, _ = (*rd)["l_registedate"].(int64)
+			if ojy, _ := (*rd)["o_jy"].(map[string]interface{}); len(ojy) > 0 {
+				if ojy["i_new"] == nil {
+					if time.Unix(regtime, 0).After(optime) {
+						saveData["o_jy.i_new"] = 1
+					} else {
+						saveData["o_jy.i_new"] = 0
+					}
+				}
+			}
+		}
 		if !a_key_ok && indexInt == 0 { //第一次新增
 			index = ""
 			saveData["o_jy.a_key"] = []map[string]interface{}{saveKey}
+			if time.Unix(regtime, 0).Before(optime) {
+				saveData["o_jy.i_new"] = 1
+			}
 		} else { //修改新增
 			if indexInt > len(a_key) {
 				indexInt = len(a_key)

+ 23 - 1
src/jfw/modules/app/src/app/front/wxkeyset.go

@@ -4,6 +4,8 @@ package front
 import (
 	. "app/jyutil"
 	"fmt"
+	"jfw/config"
+	"log"
 	"qfw/util"
 	"regexp"
 	"strconv"
@@ -204,14 +206,34 @@ func (m *Front) WxKeysetAjaxReq() {
 			return
 		}
 		saveKey := map[string]interface{}{
-			"key":      keys,
+			"key":      []string{keys[0]},
 			"area":     fliterEmptyArr(area),
 			"notkey":   fliterEmptyArr(notkey),
 			"infotype": fliterEmptyArr(infotype),
 		}
+		var optime time.Time
+		var regtime int64
+		if rd, ok := mongodb.FindById("user", userId, `{"o_jy":1,"l_registedate":1}`); rd != nil && ok && len(*rd) > 0 {
+			//获取活动上线时间
+			optimalTime, _ := config.Sysconfig["optimalTime"].(string)
+			optime, _ = time.ParseInLocation(util.Date_Full_Layout, optimalTime, time.Local)
+			regtime, _ = (*rd)["l_registedate"].(int64)
+			if ojy, _ := (*rd)["o_jy"].(map[string]interface{}); len(ojy) > 0 {
+				if ojy["i_new"] == nil {
+					if time.Unix(regtime, 0).After(optime) {
+						saveData["o_jy.i_new"] = 1
+					} else {
+						saveData["o_jy.i_new"] = 0
+					}
+				}
+			}
+		}
 		if !a_key_ok && indexInt == 0 { //第一次新增
 			index = ""
 			saveData["o_jy.a_key"] = []map[string]interface{}{saveKey}
+			if time.Unix(regtime, 0).Before(optime) {
+				saveData["o_jy.i_new"] = 1
+			}
 		} else { //修改新增
 			if indexInt > len(a_key) {
 				indexInt = len(a_key)

+ 2 - 1
src/jfw/modules/app/src/config.json

@@ -158,5 +158,6 @@
     "firstBindPop":3,
     "maxBindPop":8,
     "bindPopRedis":"merge",
-    "phoneFilterFlag":true
+    "phoneFilterFlag":true,
+    "optimalTime":"2021-08-03 12:00:00"
 }