|
@@ -53,17 +53,18 @@ const (
|
|
|
func getForecastProjectSql(scd *util.ViewCondition, startTime, endTime int, dataType string) string {
|
|
|
musts := []string{}
|
|
|
bools := []string{}
|
|
|
- if endTime == 0 {
|
|
|
- endTime = int(time.Now().Unix())
|
|
|
+ entTimeStr := ``
|
|
|
+ if endTime != 0 {
|
|
|
+ entTimeStr = fmt.Sprintf(`,\"lte\":%d"`, endTime)
|
|
|
}
|
|
|
name := ""
|
|
|
- mustStr := "{\"constant_score\":{\"filter\":{\"exists\":{\"field\":\"%s\"}}}},{\"range\":{\"%s\":{\"gte\":%d,\"lte\":%d}}}"
|
|
|
+ mustStr := "{\"constant_score\":{\"filter\":{\"exists\":{\"field\":\"%s\"}}}},{\"range\":{\"%s\":{\"gte\":%d %s}}}"
|
|
|
if dataType == "nj" {
|
|
|
name = "title"
|
|
|
- musts = append(musts, fmt.Sprintf(filter_must_time, "must", fmt.Sprintf(mustStr, "yucetime", "yucetime", startTime, endTime)))
|
|
|
+ musts = append(musts, fmt.Sprintf(filter_must_time, "must", fmt.Sprintf(mustStr, "yucetime", "yucetime", startTime, entTimeStr)))
|
|
|
} else {
|
|
|
name = "results.purchasing.mypurchasing"
|
|
|
- musts = append(musts, fmt.Sprintf(filter_must_time, "must_not", fmt.Sprintf(mustStr, "yuceendtime", "yuceendtime", startTime, endTime)))
|
|
|
+ musts = append(musts, fmt.Sprintf(filter_must_time, "must_not", fmt.Sprintf(mustStr, "yuceendtime", "yuceendtime", startTime, entTimeStr)))
|
|
|
}
|
|
|
//省份
|
|
|
areaCity := []string{}
|