瀏覽代碼

fix:导出筛选条件修改

duxin 1 年之前
父節點
當前提交
2c1dbbc9f1

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

@@ -167,7 +167,16 @@ func (d *DataExport) SieveData() {
 		winnerArr = strings.Split(winner, ",")
 		log.Println("winnerArr", winnerArr)
 	}
+	var isTitle int
+
 	if selectType != "" {
+		if strings.Count(selectType, "title") > 1 {
+			isTitle = 3 //包含标题及正文
+		} else if strings.Contains(selectType, "detail") {
+			isTitle = 2 //只包含正文
+		} else if strings.Contains(selectType, "title") {
+			isTitle = 1 //只包含标题
+		}
 		//去重 如果选取了标题及正文 引起的有2个title问题
 		if strings.Count(selectType, "title") > 1 {
 			var detail []string
@@ -194,6 +203,7 @@ func (d *DataExport) SieveData() {
 		"subtype":     subType,
 		"buyer":       buyerArr,
 		"buyerclass":  buyerclassArr,
+		"isTitle":     isTitle,
 		"winner":      winnerArr,
 		"comeintime":  time.Now().Unix(),
 		"comeinfrom":  "exportPage",

+ 9 - 0
src/jfw/front/wx_dataExport.go

@@ -184,7 +184,15 @@ func (w *WxDataExport) SaveData() error {
 			log.Println("keyWord param 反序列化异常,查看前后台字段是否对应")
 		}
 	}
+	var isTitle int
 	if selectType != "" {
+		if strings.Count(selectType, "title") > 1 {
+			isTitle = 3 //包含标题及正文
+		} else if strings.Contains(selectType, "detail") {
+			isTitle = 2 //只包含正文
+		} else if strings.Contains(selectType, "title") {
+			isTitle = 1 //只包含标题
+		}
 		//去重 如果选取了标题及正文 引起的有2个title问题
 		if strings.Count(selectType, "title") > 1 {
 			var detail []string
@@ -207,6 +215,7 @@ func (w *WxDataExport) SaveData() error {
 		"keywords":    keyWordArr,
 		"minprice":    min,
 		"maxprice":    max,
+		"isTitle":     isTitle,
 		"subtype":     subType,
 		"buyer":       buyerArr,
 		"buyerclass":  buyerclassArr,

+ 9 - 0
src/jfw/modules/app/src/app/front/dataExport.go

@@ -186,7 +186,15 @@ func (w *WxDataExport) SaveData() error {
 			}
 		}
 	}
+	var isTitle int
 	if selectType != "" {
+		if strings.Count(selectType, "title") > 1 {
+			isTitle = 3 //包含标题及正文
+		} else if strings.Contains(selectType, "detail") {
+			isTitle = 2 //只包含正文
+		} else if strings.Contains(selectType, "title") {
+			isTitle = 1 //只包含标题
+		}
 		//去重 如果选取了标题及正文 引起的有2个title问题
 		if strings.Count(selectType, "title") > 1 {
 			var detail []string
@@ -207,6 +215,7 @@ func (w *WxDataExport) SaveData() error {
 		"region":      regionArr,
 		"industry":    industryArr,
 		"keywords":    keyWordArr,
+		"isTitle":     isTitle,
 		"minprice":    min,
 		"maxprice":    max,
 		"subtype":     subType,

+ 13 - 9
src/jfw/modules/subscribepay/src/pay/derivedCondition.go

@@ -25,7 +25,7 @@ func CheckSave(userid, filterId string) {
 	}
 	data := make(map[string]interface{})
 	query := map[string]interface{}{
-		"user_id": userid,
+		"s_userid": userid,
 	}
 	area, _ := (*dataMap)["area"].([]interface{})
 	data["area"] = ArrSort(area)
@@ -41,12 +41,13 @@ func CheckSave(userid, filterId string) {
 	data["buyer"] = ArrSort(buyer)
 	winner, _ := (*dataMap)["winner"].([]interface{})
 	data["winner"] = ArrSort(winner)
-	keyword, _ := (*dataMap)["keyword"].([]interface{})
-	data["keyword"] = keywordSort(util.ObjArrToMapArr(keyword))
+	keyword, _ := (*dataMap)["keywords"].([]interface{})
+	data["keywords"] = keywordSort(util.ObjArrToMapArr(keyword))
 
 	data["publishtime"] = util.InterfaceToStr((*dataMap)["publishtime"])
 	data["selectType"] = ValueSort(util.InterfaceToStr((*dataMap)["selectType"]))
 	data["minprice"] = util.InterfaceToStr((*dataMap)["minprice"])
+	data["isTitle"] = util.IntAll((*dataMap)["isTitle"])
 	data["maxprice"] = util.InterfaceToStr((*dataMap)["maxprice"])
 	data["subtype"] = ValueSort(util.InterfaceToStr((*dataMap)["subtype"]))
 
@@ -59,12 +60,15 @@ func CheckSave(userid, filterId string) {
 				"update_time": tm.Unix(),
 			}}, false, false)
 	} else {
-		data["create_time"] = tm.Unix()
-		data["update_time"] = tm.Unix()
-		data["in_key"] = inKey
-		data["filter_id"] = filterId
-		data["user_id"] = userid
-		qutil.MQFW.Save("export_condition", data)
+		delete(*dataMap, "_id")
+		delete(*dataMap, "comeinfrom")
+		delete(*dataMap, "comeintime")
+
+		(*dataMap)["create_time"] = tm.Unix()
+		(*dataMap)["update_time"] = tm.Unix()
+		(*dataMap)["in_key"] = inKey
+		(*dataMap)["filter_id"] = filterId
+		qutil.MQFW.Save("export_condition", *dataMap)
 	}
 }