Browse Source

wip:筛选条件保存调整

fuwencai 2 years ago
parent
commit
2af9e33ca7

+ 11 - 0
jyBXBase/rpc/internal/logic/addsearchlogic.go

@@ -4,6 +4,7 @@ import (
 	"context"
 	"jyBXBase/rpc/bxbase"
 	IC "jyBXBase/rpc/init"
+	"jyBXBase/rpc/util"
 	"log"
 	"strings"
 	"time"
@@ -43,6 +44,16 @@ func (l *AddSearchLogic) AddSearch(in *bxbase.AddSearchReq) (res *bxbase.CommonR
 	}
 	log.Println("添加搜索列表:", in)
 	in.Keywords = strings.Replace(in.Keywords, " ", ",", -1)
+	switch in.SearchGroup {
+	case util.SearchGroupBidding:
+		if ValueSort(util.TopTypesBidding) == in.Subtype {
+			in.Subtype = ""
+		}
+	case util.SearchGroupLeadingProject:
+		if ValueSort(util.TopTypesLeadingProject) == in.Subtype {
+			in.Subtype = ""
+		}
+	}
 	newData["keywords"] = in.Keywords
 	newData["type"] = in.Type
 	newData["publish_time"] = in.PublishTime

+ 4 - 4
jyBXBase/rpc/internal/logic/checksearchlogic.go

@@ -69,12 +69,12 @@ func (l *CheckSearchLogic) CheckSearch(in *bxbase.AddSearchReq) (res *bxbase.Che
 	// 当所选择的信息类型是全选时,需要处理成和全部时一样的空串
 	switch in.SearchGroup {
 	case util.SearchGroupBidding:
-		if ValueSort(util.TopTypesBidding) == in.Industry {
-			in.Industry = ""
+		if ValueSort(util.TopTypesBidding) == in.Subtype {
+			in.Subtype = ""
 		}
 	case util.SearchGroupLeadingProject:
-		if ValueSort(util.TopTypesLeadingProject) == in.Industry {
-			in.Industry = ""
+		if ValueSort(util.TopTypesLeadingProject) == in.Subtype {
+			in.Subtype = ""
 		}
 	}