wangshan пре 1 година
родитељ
комит
5842ab2de9
1 измењених фајлова са 12 додато и 8 уклоњено
  1. 12 8
      jyBXCore/rpc/entity/search.go

+ 12 - 8
jyBXCore/rpc/entity/search.go

@@ -4,6 +4,7 @@ import (
 	MC "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/redis"
 	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/rpc/powercheck"
 	"encoding/json"
 	"fmt"
 	IC "jyBXCore/rpc/init"
@@ -158,14 +159,17 @@ func (kws *KeyWordsSearch) GetSearchKeyWordsQueryStr(in *bxcore.SearchReq) (sear
 
 // SearchParamsHandle 搜索条件 处理
 func (kws *KeyWordsSearch) SearchParamsHandle(in *bxcore.SearchReq) []string {
-	baseUserId, _ := strconv.ParseInt(in.NewUserId, 10, 64)
-	accountId, _ := strconv.ParseInt(in.AccountId, 10, 64)
-	positionType, _ := strconv.ParseInt(in.PositionType, 10, 64)
-	positionId, _ := strconv.ParseInt(in.PositionId, 10, 64)
 	//判断用户身份
-	userInfo := IC.Middleground.PowerCheckCenter.Check(in.AppId, in.MgoUserId, baseUserId, accountId, in.EntId, positionType, positionId)
-	//是否是付费用户
-	in.IsPay = !userInfo.Free.IsFree
+	var userInfo powercheck.CheckResp
+	if in.UserId != "" {
+		baseUserId, _ := strconv.ParseInt(in.NewUserId, 10, 64)
+		accountId, _ := strconv.ParseInt(in.AccountId, 10, 64)
+		positionType, _ := strconv.ParseInt(in.PositionType, 10, 64)
+		positionId, _ := strconv.ParseInt(in.PositionId, 10, 64)
+		userInfo = *IC.Middleground.PowerCheckCenter.Check(in.AppId, in.MgoUserId, baseUserId, accountId, in.EntId, positionType, positionId)
+		//是否是付费用户
+		in.IsPay = !userInfo.Free.IsFree
+	}
 	//默认搜索范围
 	if in.SelectType == "" {
 		in.SelectType = "title,content"
@@ -220,7 +224,7 @@ func (kws *KeyWordsSearch) SearchParamsHandle(in *bxcore.SearchReq) []string {
 		in.Industry = strings.TrimSpace(in.Industry)
 	}
 	//免费用户:高级筛选 采购单位类型、采购单位联系方式、中标企业联系方式、排除词、城市
-	if userInfo.Free.IsFree {
+	if !in.IsPay {
 		in.BuyerClass = ""
 		in.BuyerTel = ""
 		in.WinnerTel = ""