wkyuer hace 1 semana
padre
commit
7873c27a27

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

@@ -1,35 +1,35 @@
 package entity
 
 import (
-	"fmt"
 	"github.com/gogf/gf/v2/util/gconv"
 	"jy/src/jfw/modules/publicapply/src/config"
 )
 
 // FreeIsInTsGuide 2有向导 1跳过向导
-func FreeIsInTsGuide(userid string) int {
+// changeType 1修改订阅次 2设置修改城市
+func FreeIsInTsGuide(userid string, changeType int) int {
 	data := config.Compatible.Select(userid, `{"o_jy":1,"i_ts_guide":1,"l_registedate":1}`)
 	if data == nil || len(*data) == 0 {
 		return 0
 	}
-	fmt.Printf("FreeIsInTsGuide %v %+v", userid, data)
+	//fmt.Printf("FreeIsInTsGuide %v %+v", userid, data)
 	var (
 		o_jy       = gconv.Map((*data)["o_jy"])
 		i_ts_guide = gconv.Int64((*data)["i_ts_guide"])
 		a_key      = gconv.Interfaces(o_jy["a_key"])
 		o_area     = gconv.Map(o_jy["o_area"])
 	)
-	fmt.Printf("FreeIsInTsGuide %v  \ni_ts_guide:%v \n len(o_jy) == 0:%v\n a_key == nil || len(a_key) == 0 :%v\n o_area == nil || len(o_area) == 0: %v", userid, i_ts_guide, len(o_jy) == 0, a_key == nil || len(a_key) == 0, o_area == nil || len(o_area) == 0)
+	//fmt.Printf("FreeIsInTsGuide %v  \ni_ts_guide:%v \n len(o_jy) == 0:%v\n a_key == nil || len(a_key) == 0 :%v\n o_area == nil || len(o_area) == 0: %v", userid, i_ts_guide, len(o_jy) == 0, a_key == nil || len(a_key) == 0, o_area == nil || len(o_area) == 0)
 	if i_ts_guide == 1 {
 		return 0
 	}
 	if len(o_jy) == 0 {
 		return 2
 	}
-	if a_key == nil || len(a_key) == 0 {
+	if (a_key == nil || len(a_key) == 0) && changeType != 1 {
 		return 2
 	}
-	if o_area == nil || len(o_area) == 0 {
+	if (o_area == nil || len(o_area) == 0) && changeType != 2 {
 		return 2
 	}
 	return 1

+ 1 - 3
src/jfw/modules/publicapply/src/subscribePush/entity/keyWords.go

@@ -2,7 +2,6 @@ package entity
 
 import (
 	"fmt"
-	"github.com/gogf/gf/v2/frame/g"
 	"github.com/gogf/gf/v2/util/gconv"
 	"jy/src/jfw/modules/publicapply/src/activityday/consts"
 	"jy/src/jfw/modules/publicapply/src/config"
@@ -256,7 +255,7 @@ func AddKeyWordsFree(types, userId, classIndex, className, keywordsIndex, keywor
 			saveData[types+".a_key."+keywordsIndex+".matchway"] = matchWay
 			saveData[types+".a_key."+keywordsIndex+".updatetime"] = time.Now().Unix()
 			if gconv.Bool(sessionMap["isHelpSub"]) {
-				if v := FreeIsInTsGuide(userId); v != 0 {
+				if v := FreeIsInTsGuide(userId, 1); v != 0 {
 					saveData["i_ts_guide"] = v
 				}
 			}
@@ -267,7 +266,6 @@ func AddKeyWordsFree(types, userId, classIndex, className, keywordsIndex, keywor
 		ok = config.Compatible.Update(userId, map[string]interface{}{
 			"$set": saveData,
 		})
-		g.Dump("1----", userId, saveData)
 
 		if ok {
 			flag = true

+ 2 - 5
src/jfw/modules/publicapply/src/subscribePush/entity/setting.go

@@ -7,7 +7,6 @@ import (
 	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
 	"errors"
 	"fmt"
-	"github.com/gogf/gf/v2/frame/g"
 	"github.com/gogf/gf/v2/util/gconv"
 	"jy/src/jfw/modules/publicapply/src/config"
 	"jy/src/jfw/modules/publicapply/src/db"
@@ -122,17 +121,15 @@ func FreeSubChange(userId string, area, district *map[string]interface{}, indust
 			"o_jy.i_newfree": 1,    //老免费用户=>新订阅设置页面 20211122
 		}
 	}
-	if gconv.Bool(sessionMap["isHelpSub"]) {
-		if v := FreeIsInTsGuide(userId); v != 0 {
+	if gconv.Bool(sessionMap["isHelpSub"]) && area != nil && len(*area) > 0 {
+		if v := FreeIsInTsGuide(userId, 2); v != 0 {
 			setMap["i_ts_guide"] = v
 		}
-
 	}
 	updateOk := config.Compatible.Update(userId, map[string]interface{}{
 		"$set": setMap,
 	})
 
-	g.Dump("2----", userId, setMap)
 	if !updateOk {
 		return false
 	}