Selaa lähdekoodia

feat:app移动未登录限制信息类型

duxin 2 vuotta sitten
vanhempi
commit
71c0d39d68

+ 6 - 2
jyBXBase/rpc/internal/logic/newestbiddinglogic.go

@@ -71,6 +71,7 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
 			}
 			return res, 1
 		}
+		var subtype string
 		//登录用户
 		if in.UserId != "" {
 			//优先级 由测试确认  大会员 》 商机管理 》 VIP 》 普通用户 》 搜索历史
@@ -164,7 +165,7 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
 				//历史搜索
 				res.Data.History = strings.Split(hKeys, ",")
 				//根据订阅词获取查询语句
-				query := model.NewestQuery("", hKeys)
+				query := model.NewestQuery("", hKeys, subtype)
 				result := model.NewestES(query)
 				res.Data.IsVip = false
 				res.Data.HasSubKeys = false
@@ -172,9 +173,12 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
 				res.Data.List = result
 				return res, 0
 			}
+		} else {
+			//未登录用户访问全部信息类型 需要过滤掉 拟建和采购意向
+			subtype = "招标预告,招标公告,招标结果,招标信用信息"
 		}
 		if in.IsSearch == 2 { //定位查询(默认全国)
-			query := model.NewestQuery(rks, "")
+			query := model.NewestQuery(rks, "", subtype)
 			result := model.NewestES(query)
 			res.Data.IsVip = false
 			res.Data.HasSubKeys = false

+ 5 - 1
jyBXBase/rpc/model/newestBidding.go

@@ -154,7 +154,7 @@ func (n *NewestInfo) GetPushHistory() (res []*bxbase.NewestList) {
 }
 
 // 根据定位或者搜索历史 查es
-func NewestQuery(city, keys string) (str string) {
+func NewestQuery(city, keys, subtype string) (str string) {
 	var musts, bools []string
 	if keys != "" {
 		for _, v := range strings.Split(keys, ",") {
@@ -170,6 +170,10 @@ func NewestQuery(city, keys string) (str string) {
 	if city != "" {
 		musts = append(musts, fmt.Sprintf(query_bool_must, "city", `"`+city+`"`))
 	}
+	//未登录首页推送数据限制
+	if subtype != "" {
+		musts = append(musts, fmt.Sprintf(query_bool_must, "subtype", `"`+subtype+`"`))
+	}
 	str = fmt.Sprintf(query_city_hkeys, strings.Join(musts, ","), strings.Join(bools, ","))
 	logx.Info("str:", str)
 	return

+ 4 - 0
jyBXCore/rpc/internal/logic/getsearchlistlogic.go

@@ -58,6 +58,10 @@ func (l *GetSearchListLogic) GetSearchList(in *bxcore.SearchReq) (*bxcore.Search
 			ErrMsg:  "无权限",
 		}, nil
 	}
+	//未登录用户访问全部信息类型 需要过滤掉 拟建和采购意向
+	if in.UserId == "" && in.Subtype == "" {
+		in.Subtype = "招标预告,招标公告,招标结果,招标信用信息"
+	}
 	t := time.Now()
 	//招标信息有效查询
 	res.IsLimit = 1