瀏覽代碼

feat:信息类型

wangshan 3 年之前
父節點
當前提交
55d4da0796
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      jyBXCore/rpc/util/search.go

+ 4 - 2
jyBXCore/rpc/util/search.go

@@ -157,7 +157,7 @@ const (
 	SearchMaxPageNum       = 10  //免费用户500条记录
 	SearchMaxPageNum_PAYED = 100 //付费用户5000条记录
 
-	bidSearch_field_1 = `"_id","title","publishtime","toptype","subtype","type","area","city","s_subscopeclass","bidamount","budget","buyerclass","filetext","spidercode","site"`
+	bidSearch_field_1 = `"_id","title","publishtime","toptype","subtype","type","area","city","s_subscopeclass","bidamount","budget","buyerclass","spidercode","site"` //,"filetext"
 	bidSearch_field   = bidSearch_field_1 + `,"bidopentime","winner","buyer","projectname","projectcode","projectinfo"`
 	query_bool_should = `{"bool":{"should":[%s],"minimum_should_match": 1}}`
 )
@@ -270,13 +270,15 @@ func GetBidSearchQuery(in *bxcore.SearchReq) string {
 	alltype := ``
 	//二级分类
 	if subtype != "" {
+		var typeInt = 0
 		alltype += `{"terms":{"subtype":[`
 		for k, v := range strings.Split(subtype, ",") {
 			if ttype := MC.If(topTypeMap[v] != "" && in.Toptype == "", topTypeMap[v], "").(string); ttype != "" {
 				toptype = append(toptype, ttype)
+				typeInt += 1
 				continue
 			}
-			if k > 0 {
+			if k > typeInt {
 				alltype += `,`
 			}
 			alltype += `"` + v + `"`