浏览代码

潜在项目修改

WH01243 2 年之前
父节点
当前提交
b85bdc7e5a
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      src/jfw/modules/bigmember/src/service/analysis/forecastproject.go

+ 4 - 3
src/jfw/modules/bigmember/src/service/analysis/forecastproject.go

@@ -32,7 +32,7 @@ const (
 	bidSearch_field = ``
 
 	forecastQuery            = `{"query":{"bool":{"must":[%s],"should":[%s],"minimum_should_match":1}}}`
-	filter_must_time         = `{"bool":{"%s":[{"exists":{"field":"top_category"}}]}},{"bool":{"should":[{"bool":{"must":[{"constant_score":{"filter":{"exists":{"field":"yuceendtime"}}}},{"range":{"yuceendtime":{"gte":%d,"lte":%d}}}]}}]}}`
+	filter_must_time         = `{"bool":{"%s":[{"exists":{"field":"top_category"}}]}},{"bool":{"should":[{"bool":{"must":[%s]}}]}}`
 	filter_must_area_city    = `{"bool":{"should":[%s]}}`
 	query_should_keys        = `{"bool":{"must":[%s],"must_not":[%s]}}`
 	query_should_multi_match = `{"multi_match":{"query":"%s","type":"phrase","fields":["%s"]}}`
@@ -57,12 +57,13 @@ func getForecastProjectSql(scd *util.ViewCondition, startTime, endTime int, data
 		endTime = int(time.Now().Unix())
 	}
 	name := ""
+	mustStr := "{\"constant_score\":{\"filter\":{\"exists\":{\"field\":\"%s\"}}}},{\"range\":{\"%s\":{\"gte\":%d,\"lte\":%d}}}"
 	if dataType == "nj" {
 		name = "title"
-		musts = append(musts, fmt.Sprintf(filter_must_time, "must", startTime, endTime))
+		musts = append(musts, fmt.Sprintf(filter_must_time, "must", fmt.Sprintf(mustStr, "yucetime", "yucetime", startTime, endTime)))
 	} else {
 		name = "results.purchasing.mypurchasing"
-		musts = append(musts, fmt.Sprintf(filter_must_time, "must_not", startTime, endTime))
+		musts = append(musts, fmt.Sprintf(filter_must_time, "must_not", fmt.Sprintf(mustStr, "yuceendtime", "yuceendtime", startTime, endTime)))
 	}
 	//省份
 	areaCity := []string{}