Quellcode durchsuchen

feat:数据导出

wangshan vor 3 Jahren
Ursprung
Commit
1df9de9dc0
3 geänderte Dateien mit 14 neuen und 1 gelöschten Zeilen
  1. 1 0
      src/jfw/front/dataExport.go
  2. 2 1
      src/jfw/modules/app/src/config.json
  3. 11 0
      src/jfw/public/dataexport.go

+ 1 - 0
src/jfw/front/dataExport.go

@@ -413,6 +413,7 @@ func (d *DataExport) SuperSearchExport() error {
 	saveData["s_openid"] = openid
 	saveData["s_userid"] = userId
 	saveData["comeinfrom"] = "supersearchPage"
+
 	region := util.If(reqData.Area == "全国", "", reqData.Area).(string)
 	if region != "" && reqData.City != "" {
 		region += "," + reqData.City

+ 2 - 1
src/jfw/modules/app/src/config.json

@@ -163,5 +163,6 @@
     "criticality":2,
     "canReadNotice": 3,
     "namePrefix":"JY_%s",
-    "smsServiceRpc":"127.0.0.1:932"
+    "smsServiceRpc":"127.0.0.1:932",
+    "searchTypeSwitch": true
 }

+ 11 - 0
src/jfw/public/dataexport.go

@@ -2,6 +2,7 @@ package public
 
 import (
 	"fmt"
+	"jfw/config"
 	"jfw/modules/common/src/qfw/util/jy"
 	"log"
 	"qfw/util"
@@ -170,6 +171,16 @@ func (this *BidSearchExport) PassBidSearchExport() (returnData map[string]interf
 		endtime := fmt.Sprint(now.Unix())
 		publishtimeSave = fmt.Sprintf("%s_%s", starttime, endtime)
 	}
+	//
+	searchTypeSwitch, _ := config.Sysconfig["searchTypeSwitch"].(bool)
+	//标题+全文搜索 搜索类型开关打开 默认搜索全文;(全文包含标题)(单字排除)
+	if searchTypeSwitch && strings.Contains(this.SelectType, "content") && strings.Contains(this.SelectType, "title") {
+		if strings.Contains(this.SelectType, "title,") {
+			this.SelectType = strings.Replace(this.SelectType, "title,", "", -1)
+		} else if strings.Contains(this.SelectType, ",title") {
+			this.SelectType = strings.Replace(this.SelectType, ",title", "", -1)
+		}
+	}
 	returnData = map[string]interface{}{
 		"keywords":     KeyWordSave,
 		"publishtime":  publishtimeSave,