WH01243 1 rok temu
rodzic
commit
12d7ff9e15
1 zmienionych plików z 5 dodań i 5 usunięć
  1. 5 5
      common/src/qfw/util/dataexport/dataexport.go

+ 5 - 5
common/src/qfw/util/dataexport/dataexport.go

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