|
@@ -5,6 +5,7 @@ import (
|
|
"encoding/json"
|
|
"encoding/json"
|
|
"errors"
|
|
"errors"
|
|
"fmt"
|
|
"fmt"
|
|
|
|
+ "github.com/gogf/gf/v2/util/gconv"
|
|
"log"
|
|
"log"
|
|
"math"
|
|
"math"
|
|
"regexp"
|
|
"regexp"
|
|
@@ -70,7 +71,7 @@ type SieveCondition struct {
|
|
SearchGroup int `json:"searchGroup"` // 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
|
|
SearchGroup int `json:"searchGroup"` // 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
|
|
SearchMode int `json:"searchMode"` // 搜索模式:0:精准搜索;1:模糊搜索
|
|
SearchMode int `json:"searchMode"` // 搜索模式:0:精准搜索;1:模糊搜索
|
|
WordsMode int `json:"wordsMode"` // 搜索关键词模式;默认0:包含所有,1:包含任意
|
|
WordsMode int `json:"wordsMode"` // 搜索关键词模式;默认0:包含所有,1:包含任意
|
|
- District string `json:"district"`
|
|
|
|
|
|
+ District []string `json:"district"`
|
|
}
|
|
}
|
|
|
|
|
|
const (
|
|
const (
|
|
@@ -154,10 +155,9 @@ func getDataExportSql(scd *SieveCondition) string {
|
|
areaquery += `]}}`
|
|
areaquery += `]}}`
|
|
areaCity = append(areaCity, areaquery)
|
|
areaCity = append(areaCity, areaquery)
|
|
}
|
|
}
|
|
-
|
|
|
|
district := scd.District
|
|
district := scd.District
|
|
- if district != "" {
|
|
|
|
- for _, v := range strings.Split(district, ",") {
|
|
|
|
|
|
+ if len(district) > 0 {
|
|
|
|
+ for _, v := range district {
|
|
cityName := strings.Split(v, "_")[0]
|
|
cityName := strings.Split(v, "_")[0]
|
|
districtName := strings.Split(v, "_")[1]
|
|
districtName := strings.Split(v, "_")[1]
|
|
query_bool_must_and_district := `{"bool":{"must":[{"terms":{"city":["%s"]}},{"terms":{"district":["%s"]}}]}}`
|
|
query_bool_must_and_district := `{"bool":{"must":[{"terms":{"city":["%s"]}},{"terms":{"district":["%s"]}}]}}`
|
|
@@ -504,7 +504,7 @@ func GetSqlObjFromId(mongo mg.MongodbSim, _id string) *SieveCondition {
|
|
SearchGroup: qutil.IntAll((*query)["searchGroup"]), //搜索分组:默认0:全部;1:招标采购公告;2:超前项目
|
|
SearchGroup: qutil.IntAll((*query)["searchGroup"]), //搜索分组:默认0:全部;1:招标采购公告;2:超前项目
|
|
SearchMode: qutil.IntAll((*query)["searchMode"]), // 搜索模式:0:精准搜索;1:模糊搜索
|
|
SearchMode: qutil.IntAll((*query)["searchMode"]), // 搜索模式:0:精准搜索;1:模糊搜索
|
|
WordsMode: qutil.IntAll((*query)["wordsMode"]), // 搜索关键词模式;默认0:包含所有,1:包含任意
|
|
WordsMode: qutil.IntAll((*query)["wordsMode"]), // 搜索关键词模式;默认0:包含所有,1:包含任意
|
|
- District: qutil.ObjToString((*query)["publishtime"]),
|
|
|
|
|
|
+ District: gconv.Strings((*query)["district"]),
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|