浏览代码

用户注册时间

wangshan 3 年之前
父节点
当前提交
c0a68a2a2a

+ 1 - 1
src/jfw/front/login.go

@@ -115,7 +115,7 @@ func (l *Login) Login() error {
 						"s_company":     s_company,
 						"o_jy": map[string]interface{}{
 							"i_apppush":    1,
-							"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
+							// "i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 							"i_ratemode":   2,
 							"l_modifydate": time.Now().Unix(),
 						},

+ 2 - 2
src/jfw/front/otherAct.go

@@ -134,8 +134,8 @@ func (f *Front) Lpsubmit() error {
 				"l_registedate": time.Now().Unix(),
 				"i_ts_guide":    2,
 				"o_jy": map[string]interface{}{
-					"i_apppush":    1,
-					"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
+					"i_apppush": 1,
+					// "i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 					"i_ratemode":   2,
 					"l_modifydate": time.Now().Unix(),
 				},

+ 3 - 3
src/jfw/front/pchelper.go

@@ -126,9 +126,9 @@ func (l *PcHelper) Login() error {
 							"l_registedate": time.Now().Unix(),
 							"i_ts_guide":    2,
 							"o_jy": map[string]interface{}{
-								"i_apppush":    1,
-								"i_ratemode":   2,
-								"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
+								"i_apppush":  1,
+								"i_ratemode": 2,
+								// "i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 								"l_modifydate": time.Now().Unix(),
 							},
 							"s_regsource": "pchelper",

+ 9 - 9
src/jfw/modules/app/src/app/front/login.go

@@ -204,9 +204,9 @@ func (l *Login) Login() error {
 						"s_appponetype": phoneType,
 						"i_ts_guide":    2,
 						"o_jy": map[string]interface{}{
-							"i_apppush":    1,
-							"i_ratemode":   2,
-							"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
+							"i_apppush":  1,
+							"i_ratemode": 2,
+							// "i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 							"l_modifydate": time.Now().Unix(),
 						},
 						"s_platform": "app",
@@ -462,9 +462,9 @@ func (l *Login) Register() error {
 					data["l_registedate"] = time.Now().Unix()
 					data["i_ts_guide"] = 2
 					data["o_jy"] = map[string]interface{}{
-						"i_apppush":    1,
-						"i_ratemode":   2,
-						"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
+						"i_apppush":  1,
+						"i_ratemode": 2,
+						// "i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 						"l_modifydate": time.Now().Unix(),
 					}
 					data["s_regsource"] = isAndroidOrIOS(l.Header("User-Agent"))
@@ -607,9 +607,9 @@ func (l *Login) WxLogin() {
 				"s_city":         u.City,
 				"s_headimageurl": u.HeadImageUrl,
 				"o_jy": map[string]interface{}{
-					"i_apppush":    1,
-					"i_ratemode":   2,
-					"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
+					"i_apppush":  1,
+					"i_ratemode": 2,
+					// "i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 					"l_modifydate": time.Now().Unix(),
 				},
 				"s_platform": "app", //用户注册平台 app 微信 pc

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

@@ -56,5 +56,6 @@
 			"name":"赵秀臻",
 			"wxer":"/big-member/image/customer/customer-wx.png"
 		}
-    ]
+    ],
+    "newFreeUser":1637647199
 }

+ 1 - 0
src/jfw/modules/bigmember/src/config/config.go

@@ -32,6 +32,7 @@ type config struct {
 	RegWinner           string
 	OldSubscribeMoveTip int64
 	Customers           []customerInfo
+	NewFreeUser         int64 //免费用户 -- 订阅升级新用户
 }
 type customerInfo struct {
 	Name string `json:"name"`

+ 5 - 1
src/jfw/modules/bigmember/src/service/use/use.go

@@ -615,7 +615,11 @@ func (u *Use) IsAdd() {
 		d["freeEntPort"] = bigPower.FreeEntPort     //免费用户可查看企业画像次数
 		d["freeBuyerPort"] = bigPower.FreeBuyerPort //免费用户可查看采购单位画像次数
 		d["freeFile"] = bigPower.FreeFile           //免费用户可以进行附件下载次数
-		d["isUpgrade"] = bigPower.IsUpgrade         //是否是升级后的免费用户  默认true
+		d["isUpgrade"] = bigPower.IsUpgrade         //是否是升级后的免费用户  默认false
+		//新用户->新订阅设置页面
+		if config.Config.NewFreeUser < bigPower.Registedate {
+			d["isUpgrade"] = true
+		}
 		uid := userid
 		if bigPower.Pid != "" {
 			uid = bigPower.Pid

+ 7 - 5
src/jfw/modules/common/src/qfw/util/jy/bigVipPower.go

@@ -27,10 +27,11 @@ type BigVipBaseMsg struct {
 	VipStatus  int    `json:"vip_status"` //超级订阅状态
 	Vip_BuySet BuySet `json:"vip_buyset"` //超级订阅套餐内容
 
-	FreeEntPort   int  `json:"freeEntPort"`   //免费用户可查看企业画像次数
-	FreeBuyerPort int  `json:"freeBuyerPort"` //免费用户可查看采购单位画像次数
-	FreeFile      int  `json:"freeFile"`      //免费用户可进行附件下载次数
-	IsUpgrade     bool `json:"isUpgrade"`     //是否是免费用户订阅升级用户 默认true
+	FreeEntPort   int   `json:"freeEntPort"`   //免费用户可查看企业画像次数
+	FreeBuyerPort int   `json:"freeBuyerPort"` //免费用户可查看采购单位画像次数
+	FreeFile      int   `json:"freeFile"`      //免费用户可进行附件下载次数
+	IsUpgrade     bool  `json:"isUpgrade"`     //是否是免费用户订阅升级用户 默认true
+	Registedate   int64 `json:"registedate"`   //用户注册时间
 }
 
 //超级订阅购买内容
@@ -108,8 +109,9 @@ func GetBigVipUserBaseMsg(userId string, mysql *mysql.Mysql, mg MongodbSim) *Big
 		}
 	}
 	//大会员状态
-	data, ok := mg.FindById("user", userId, `{"i_member_status":1,"i_member_give":1,"s_member_mainid":1,"i_member_sub_status":1,"i_member_trial":1,"i_vip_status":1,"o_vipjy":1,"o_jy":1}`)
+	data, ok := mg.FindById("user", userId, `{"i_member_status":1,"i_member_give":1,"s_member_mainid":1,"i_member_sub_status":1,"i_member_trial":1,"i_vip_status":1,"o_vipjy":1,"o_jy":1,"l_registedate":1}`)
 	if ok && *data != nil && len(*data) > 0 {
+		userPower.Registedate = qutil.Int64All((*data)["l_registedate"])
 		userPower.Status = qutil.IntAllDef((*data)["i_member_status"], 0)
 		//子账号被启用
 		i_member_sub_status := qutil.IntAllDef((*data)["i_member_sub_status"], 0)

+ 9 - 7
src/jfw/modules/publicapply/src/adLeague/service/service.go

@@ -49,13 +49,15 @@ func (this *Ad) AdL(typ string) {
 		defer res.Body.Close()
 		bs, _ := ioutil.ReadAll(res.Body)
 		//log.Println("返回内容:" + string(bs))
-		resMap := map[string]interface{}{}
-		err = json.Unmarshal([]byte(bs), &resMap)
-		if err != nil {
-			log.Println("json.unmarshal err", resMap)
-		} else {
-			if qu.IntAll(resMap["Code"]) == 1 {
-				return Result{Data: true}
+		if len(bs) > 0 {
+			resMap := map[string]interface{}{}
+			err = json.Unmarshal([]byte(bs), &resMap)
+			if err != nil {
+				log.Println("json.unmarshal err", resMap)
+			} else {
+				if qu.IntAll(resMap["Code"]) == 1 {
+					return Result{Data: true}
+				}
 			}
 		}
 		return Result{Data: false}

+ 25 - 6
src/jfw/modules/publicapply/src/subscribePush/entity/keyWords.go

@@ -101,7 +101,8 @@ func directSubKWSFree(updateItems string, keys string, userId string) map[string
 						"updatetime": time.Now().Unix(),
 					},
 				},
-				"l_modifydate": time.Now().Unix(),
+				updateItems + ".l_modifydate": time.Now().Unix(),
+				updateItems + ".i_newfree":    1, //老免费用户=>新订阅设置页面 20211122
 			},
 			}); ok {
 				flag = "y"
@@ -131,6 +132,7 @@ func directSubKWSFree(updateItems string, keys string, userId string) map[string
 					"$set": bson.M{
 						updateItems + ".l_modifydate": time.Now().Unix(),
 						updateItems + ".s_item":       classify_name,
+						updateItems + ".i_newfree":    1, //老免费用户=>新订阅设置页面 20211122
 					},
 				})
 				if ok {
@@ -139,6 +141,10 @@ func directSubKWSFree(updateItems string, keys string, userId string) map[string
 			}
 		}
 	}
+	if flag == "y" {
+		//清楚缓存
+		jy.ClearBigVipUserPower(userId)
+	}
 	return map[string]interface{}{"flag": flag}
 }
 
@@ -188,7 +194,8 @@ func AddKeyWordsFree(types, userId, classIndex, className, keywordsIndex, keywor
 		if !errs {
 			db.Mgo.UpdateById("user", userId, map[string]interface{}{
 				"$set": map[string]interface{}{
-					types + ".a_key": []map[string]interface{}{},
+					types + ".a_key":     []map[string]interface{}{},
+					types + ".i_newfree": 1, //老免费用户=>新订阅设置页面 20211122
 				},
 			})
 		}
@@ -226,6 +233,7 @@ func AddKeyWordsFree(types, userId, classIndex, className, keywordsIndex, keywor
 		} else {
 			//修改关键词
 			saveData[types+".s_item"] = className
+			saveData[types+".i_newfree"] = 1 //老免费用户=>新订阅设置页面 20211122
 			saveData[types+".a_key."+keywordsIndex+".key"] = newKws
 			saveData[types+".a_key."+keywordsIndex+".appendkey"] = append(appendKeyword, _kws[1:]...)
 			saveData[types+".a_key."+keywordsIndex+".notkey"] = notKeyword
@@ -234,9 +242,13 @@ func AddKeyWordsFree(types, userId, classIndex, className, keywordsIndex, keywor
 		}
 	}
 	if len(saveData) > 0 {
-		flag = db.Mgo.UpdateById("user", userId, map[string]interface{}{
+		if db.Mgo.UpdateById("user", userId, map[string]interface{}{
 			"$set": saveData,
-		})
+		}) {
+			flag = true
+			//清楚缓存
+			jy.ClearBigVipUserPower(userId)
+		}
 		SetLog(userId, types)
 	}
 	return map[string]interface{}{"flag": flag, "msg": ""}
@@ -507,11 +519,18 @@ func (this *UpdateOther) UpdateOther() map[string]interface{} {
 		return nil
 	}()
 	flag := true
+	if types == "o_jy" {
+		setMap["o_jy.i_newfree"] = 1 //老免费用户=>新订阅设置页面 20211122
+	}
 	log.Println(setMap)
 	if setMap != nil {
-		flag = db.Mgo.UpdateById("user", this.UserId, map[string]interface{}{
+		if db.Mgo.UpdateById("user", this.UserId, map[string]interface{}{
 			"$set": setMap,
-		})
+		}) {
+			flag = true
+			//清楚缓存
+			jy.ClearBigVipUserPower(this.UserId)
+		}
 		SetLog(this.UserId, types)
 	}
 	return map[string]interface{}{"flag": flag, "msg": ""}

+ 0 - 1
src/jfw/modules/publicapply/src/subscribePush/service/subscribe.go

@@ -67,7 +67,6 @@ func (s *Subscribe) SetUserInfo() {
 		pmindex, _ := s.GetInteger("pmindex")
 		matchtype, _ := s.GetInteger("matchtype")
 		other, _ := s.GetInteger("other")
-		log.Println("--:", s.GetString("pageType"))
 		uo := &entity.UpdateOther{
 			PageType:        s.GetString("pageType"),
 			Pmindex:         pmindex,

+ 1 - 1
src/jfw/modules/subscribepay/src/service/userAccountInfo.go

@@ -649,7 +649,7 @@ func (this *UserAccount) WxUnBind() {
 			(*unsetMap)["o_jy"] = map[string]interface{}{
 				"i_wxpush":   1,
 				"i_ratemode": 2,
-				"i_newfree":  1, //新免费用户=>新订阅设置页面 20211122
+				// "i_newfree":  1, //新免费用户=>新订阅设置页面 20211122
 			}
 			//公众号微信关注移至另一用户中  此时微信公众号用户session问题错乱
 			if saveId := util.MQFW.Save("user", unsetMap); saveId == "" {

+ 3 - 3
src/jfw/modules/weixin/src/wx/wx.go

@@ -501,8 +501,8 @@ func saveUser(u *UserInfo, source, pre, RSource, CSource string) (bool, string,
 		if newUser["o_jy"] == nil {
 			newUser["i_ts_guide"] = 2
 			newUser["o_jy"] = map[string]interface{}{
-				"i_wxpush":   1,
-				"i_newfree":  1, //新免费用户=>新订阅设置页面 20211122
+				"i_wxpush": 1,
+				// "i_newfree":  1, //新免费用户=>新订阅设置页面 20211122
 				"i_ratemode": 2,
 			}
 		} else {
@@ -589,7 +589,6 @@ func saveUser(u *UserInfo, source, pre, RSource, CSource string) (bool, string,
 				"s_sourceid":      source,
 				"i_sourceid":      isourceid,
 				"o_jy.i_wxpush":   1,
-				"o_jy.i_newfree":  1, //新免费用户=>新订阅设置页面 20211122
 				"i_ispush":        1,
 				"s_headimageurl":  u.HeadImageUrl,
 				"s_nickname":      u.Nickname,
@@ -597,6 +596,7 @@ func saveUser(u *UserInfo, source, pre, RSource, CSource string) (bool, string,
 				"s_country":       u.Country,
 				"s_city":          u.City,
 				"i_sex":           u.Sex,
+				// "o_jy.i_newfree":  1, //新免费用户=>新订阅设置页面 20211122
 			}
 			set["i_applystatus"] = 1
 			if tuser["l_registedate"] == nil {