瀏覽代碼

Merge branch 'feature/v4.8.70' of https://jygit.jydev.jianyu360.cn/qmx/jy into dev/v4.8.70_wmh

wenmenghao321 1 年之前
父節點
當前提交
6ad151df7a

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

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

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

@@ -184,7 +184,15 @@ func (w *WxDataExport) SaveData() error {
 			log.Println("keyWord param 反序列化异常,查看前后台字段是否对应")
 			log.Println("keyWord param 反序列化异常,查看前后台字段是否对应")
 		}
 		}
 	}
 	}
+	var isTitle int
 	if selectType != "" {
 	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问题
 		//去重 如果选取了标题及正文 引起的有2个title问题
 		if strings.Count(selectType, "title") > 1 {
 		if strings.Count(selectType, "title") > 1 {
 			var detail []string
 			var detail []string
@@ -207,6 +215,7 @@ func (w *WxDataExport) SaveData() error {
 		"keywords":    keyWordArr,
 		"keywords":    keyWordArr,
 		"minprice":    min,
 		"minprice":    min,
 		"maxprice":    max,
 		"maxprice":    max,
+		"isTitle":     isTitle,
 		"subtype":     subType,
 		"subtype":     subType,
 		"buyer":       buyerArr,
 		"buyer":       buyerArr,
 		"buyerclass":  buyerclassArr,
 		"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 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问题
 		//去重 如果选取了标题及正文 引起的有2个title问题
 		if strings.Count(selectType, "title") > 1 {
 		if strings.Count(selectType, "title") > 1 {
 			var detail []string
 			var detail []string
@@ -207,6 +215,7 @@ func (w *WxDataExport) SaveData() error {
 		"region":      regionArr,
 		"region":      regionArr,
 		"industry":    industryArr,
 		"industry":    industryArr,
 		"keywords":    keyWordArr,
 		"keywords":    keyWordArr,
+		"isTitle":     isTitle,
 		"minprice":    min,
 		"minprice":    min,
 		"maxprice":    max,
 		"maxprice":    max,
 		"subtype":     subType,
 		"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{})
 	data := make(map[string]interface{})
 	query := map[string]interface{}{
 	query := map[string]interface{}{
-		"user_id": userid,
+		"s_userid": userid,
 	}
 	}
 	area, _ := (*dataMap)["area"].([]interface{})
 	area, _ := (*dataMap)["area"].([]interface{})
 	data["area"] = ArrSort(area)
 	data["area"] = ArrSort(area)
@@ -41,12 +41,13 @@ func CheckSave(userid, filterId string) {
 	data["buyer"] = ArrSort(buyer)
 	data["buyer"] = ArrSort(buyer)
 	winner, _ := (*dataMap)["winner"].([]interface{})
 	winner, _ := (*dataMap)["winner"].([]interface{})
 	data["winner"] = ArrSort(winner)
 	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["publishtime"] = util.InterfaceToStr((*dataMap)["publishtime"])
 	data["selectType"] = ValueSort(util.InterfaceToStr((*dataMap)["selectType"]))
 	data["selectType"] = ValueSort(util.InterfaceToStr((*dataMap)["selectType"]))
 	data["minprice"] = util.InterfaceToStr((*dataMap)["minprice"])
 	data["minprice"] = util.InterfaceToStr((*dataMap)["minprice"])
+	data["isTitle"] = util.IntAll((*dataMap)["isTitle"])
 	data["maxprice"] = util.InterfaceToStr((*dataMap)["maxprice"])
 	data["maxprice"] = util.InterfaceToStr((*dataMap)["maxprice"])
 	data["subtype"] = ValueSort(util.InterfaceToStr((*dataMap)["subtype"]))
 	data["subtype"] = ValueSort(util.InterfaceToStr((*dataMap)["subtype"]))
 
 
@@ -59,12 +60,15 @@ func CheckSave(userid, filterId string) {
 				"update_time": tm.Unix(),
 				"update_time": tm.Unix(),
 			}}, false, false)
 			}}, false, false)
 	} else {
 	} 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)
 	}
 	}
 }
 }
 
 

+ 41 - 5
src/jfw/modules/subscribepay/src/service/dataexportPack.go

@@ -48,7 +48,7 @@ type DataExportPack struct {
 func (des *DataExportPack) ScreenList() {
 func (des *DataExportPack) ScreenList() {
 	data, err := func() (*[]map[string]interface{}, error) {
 	data, err := func() (*[]map[string]interface{}, error) {
 		qMap := map[string]interface{}{
 		qMap := map[string]interface{}{
-			"user_id": des.GetSession("userId"),
+			"s_userid": des.GetSession("userId"),
 			"update_time": map[string]interface{}{
 			"update_time": map[string]interface{}{
 				"$gte": time.Now().AddDate(-1, 0, 0).Unix(),
 				"$gte": time.Now().AddDate(-1, 0, 0).Unix(),
 			},
 			},
@@ -59,8 +59,45 @@ func (des *DataExportPack) ScreenList() {
 			return nil, errors.New("获取筛选条件失败")
 			return nil, errors.New("获取筛选条件失败")
 		}
 		}
 		if data != nil && len(*data) > 0 {
 		if data != nil && len(*data) > 0 {
-			for _, v := range *data {
-				v["_id"] = encrypt.SE.EncodeString(qutil.InterfaceToStr(v["_id"]))
+			for _, dataMap := range *data {
+				area, _ := dataMap["area"].([]interface{})
+				dataMap["area"] = strings.Join(qutil.ObjArrToStringArr(area), ",")
+				city, _ := dataMap["city"].([]interface{})
+				dataMap["city"] = strings.Join(qutil.ObjArrToStringArr(city), ",")
+				region, _ := dataMap["region"].([]interface{})
+				dataMap["region"] = strings.Join(qutil.ObjArrToStringArr(region), ",")
+				industry, _ := dataMap["industry"].([]interface{})
+				dataMap["industry"] = strings.Join(qutil.ObjArrToStringArr(industry), ",")
+				buyerclass, _ := dataMap["buyerclass"].([]interface{})
+				dataMap["buyerclass"] = strings.Join(qutil.ObjArrToStringArr(buyerclass), ",")
+				buyer, _ := dataMap["buyer"].([]interface{})
+				dataMap["buyer"] = strings.Join(qutil.ObjArrToStringArr(buyer), ",")
+				winner, _ := dataMap["winner"].([]interface{})
+				dataMap["winner"] = strings.Join(qutil.ObjArrToStringArr(winner), ",")
+				keywords, _ := dataMap["keywords"].([]interface{})
+				if keywords != nil && len(keywords) > 0 {
+					mb, _ := json.Marshal(dataMap["keywords"])
+					dataMap["keywords"] = string(mb)
+				} else {
+					dataMap["keywords"] = ""
+				}
+				dataMap["publishtime"] = qutil.InterfaceToStr(dataMap["publishtime"])
+				dataMap["selectType"] = qutil.InterfaceToStr(dataMap["selectType"])
+				dataMap["minprice"] = qutil.InterfaceToStr(dataMap["minprice"])
+				dataMap["isTitle"] = qutil.IntAll(dataMap["isTitle"])
+				dataMap["maxprice"] = qutil.InterfaceToStr(dataMap["maxprice"])
+				dataMap["subtype"] = qutil.InterfaceToStr(dataMap["subtype"])
+
+				dataMap["_id"] = encrypt.SE.EncodeString(qutil.InterfaceToStr(dataMap["_id"]))
+
+				isTitle := qutil.IntAll(dataMap["isTitle"])
+				selectType := qutil.InterfaceToStr(dataMap["selectType"])
+				if isTitle == 3 {
+					selectType = selectType + ",title"
+				}
+				dataMap["selectType"] = selectType
+				delete(dataMap, "user_id")
+				delete(dataMap, "filter_id")
 			}
 			}
 		}
 		}
 		return data, nil
 		return data, nil
@@ -90,7 +127,7 @@ func (des *DataExportPack) ScreenDelete() {
 		}
 		}
 		//log.Println("userid", userid, idArr)
 		//log.Println("userid", userid, idArr)
 		util.MQFW.Delete("export_condition", map[string]interface{}{
 		util.MQFW.Delete("export_condition", map[string]interface{}{
-			"user_id": userid,
+			"s_userid": userid,
 			"_id": map[string]interface{}{
 			"_id": map[string]interface{}{
 				"$in": idArr,
 				"$in": idArr,
 			},
 			},
@@ -170,7 +207,6 @@ func (this *DataExportPack) CreateOrder() {
 			endTime := qutil.Int64All((*userfilter)["endTime"])
 			endTime := qutil.Int64All((*userfilter)["endTime"])
 			if startTime != 0 {
 			if startTime != 0 {
 				if startTime <= time.Now().Unix() && endTime >= time.Now().Unix() {
 				if startTime <= time.Now().Unix() && endTime >= time.Now().Unix() {
-
 					disWordStr = qutil.ObjToString((*userfilter)["disWords"])
 					disWordStr = qutil.ObjToString((*userfilter)["disWords"])
 				}
 				}
 			}
 			}