Explorar el Código

fix:精准不足50搜索匹配模糊搜索数

duxin hace 1 año
padre
commit
0576556aec
Se han modificado 1 ficheros con 47 adiciones y 5 borrados
  1. 47 5
      jyBXCore/rpc/internal/logic/getsearchlistlogic.go

+ 47 - 5
jyBXCore/rpc/internal/logic/getsearchlistlogic.go

@@ -70,6 +70,49 @@ func (l *GetSearchListLogic) GetSearchList(in *bxcore.SearchReq) (*bxcore.Search
 		//
 		in.SelectType = strings.Join(selectType, ",")
 	}
+	//模糊检索数重新格式化
+	nin := &bxcore.SearchReq{
+		AppId:           in.AppId,
+		UserId:          in.UserId,
+		Phone:           in.Phone,
+		NewUserId:       in.NewUserId,
+		EntId:           in.EntId,
+		EntUserId:       in.EntUserId,
+		PageNum:         in.PageNum,
+		PageSize:        in.PageSize,
+		Province:        in.Province,
+		City:            in.City,
+		Subtype:         in.Subtype,
+		TopType:         in.TopType,
+		PublishTime:     in.PublishTime,
+		SelectType:      in.SelectType,
+		Price:           in.Price,
+		Industry:        in.Industry,
+		BuyerClass:      in.BuyerClass,
+		BuyerTel:        in.BuyerTel,
+		WinnerTel:       in.WinnerTel,
+		FileExists:      in.FileExists,
+		SearchGroup:     in.SearchGroup,
+		SearchMode:      1,
+		WordsMode:       in.WordsMode,
+		KeyWords:        in.KeyWords,
+		AdditionalWords: in.AdditionalWords,
+		ExclusionWords:  in.ExclusionWords,
+		UserType:        in.UserType,
+		Platform:        in.Platform,
+		BidField:        in.BidField,
+		PositionType:    in.PositionType,
+		PositionId:      in.PositionId,
+		AccountId:       in.AccountId,
+		MgoUserId:       in.MgoUserId,
+		LimitFlag:       in.LimitFlag,
+		IsNew:           in.IsNew,
+		District:        in.District,
+		Buyer:           in.Buyer,
+		Winner:          in.Winner,
+		Agency:          in.Agency,
+		IsFuzzyNumber:   true,
+	}
 	//处理搜索条件
 	heightWords := ks.SearchParamsHandle(in)
 	if in.PageNum < 0 && in.PageSize < 0 {
@@ -124,11 +167,10 @@ func (l *GetSearchListLogic) GetSearchList(in *bxcore.SearchReq) (*bxcore.Search
 			res.Count, res.Total, res.List = ks.GetBidSearchList(in)
 			// 精准模式不足50条的非空标讯查询 匹配模糊查询数
 			if res.Count < 50 && in.SearchMode == 0 && in.KeyWords != "" &&
-				(in.SearchGroup == 1 || in.SearchGroup == 3 || in.SearchGroup == 4 || in.SearchGroup == 5) {
-				in.IsFuzzyNumber = true
-				in.SearchMode = 1
-				ks.SearchParamsHandle(in)
-				res.BCount = service.GetBidSearchCount(in)
+				(in.SearchGroup == 0 || in.SearchGroup == 3 || in.SearchGroup == 4 || in.SearchGroup == 5) {
+				ks.SearchParamsHandle(nin)
+				res.BCount = service.GetBidSearchCount(nin)
+				log.Println("精准查询数据不足 匹配模糊查询数:", res.BCount)
 			}
 
 			log.Println("2查询耗时:", time.Since(t2))