wangshan 5 lat temu
rodzic
commit
708590b2a4

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

@@ -489,7 +489,7 @@ func (d *DataExport) SuperSearchExport() error {
 		publishtime = fmt.Sprintf("%s_%d", starttime, now.Unix())
 	} else if publishtime == "thisyear" { //去年
 		starttime := fmt.Sprint(time.Date(now.Year()-1, 1, 1, 0, 0, 0, 0, time.Local).Unix())
-		endtime := fmt.Sprint(time.Date(now.Year(), 1, 1, 0, 0, 0, 0, time.Local).Unix())
+		endtime := fmt.Sprint(time.Date(now.Year()-1, 12, 31, 23, 59, 59, 0, time.Local).Unix())
 		publishtime = fmt.Sprintf("%s_%s", starttime, endtime)
 	}
 

+ 2 - 14
src/jfw/front/supsearch.go

@@ -246,29 +246,17 @@ func (p *Pcsearch) PcSearchIndex() error {
 		if list != nil {
 			listSize = len(*list)
 		}
-		if len([]rune(s_word)) > 3 && int(count) < pc_pageSize {
+		//所有的再次分词查询 只查标题
+		if len([]rune(s_word)) > 3 && int(count) < pc_pageSize && selectType == "title" {
 			secondKWS = jy.HttpEs(s_word, "ik_smart", config.Sysconfig["elasticsearch"].(string))
 			findfields := `"title"`
 			qstr := getSearchQuery(secondKWS, industry, minprice, maxprice, findfields, getBidSearchQuery(area, publishtime, subtype))
-			//			var secondCount int64 = 0
-			//			if qstr != "" {
-			//				secondCount = elastic.Count(INDEX, TYPE, qstr)
-			//			}
 			secondLimit := 2*pc_pageSize - int(count)
 			secRel := elastic.GetAllByNgram(INDEX, TYPE, qstr, findfields, bidSearch_sort, bidSearch_field, 0, secondLimit, 0, false)
 			if secRel != nil {
 				public.BidListConvert(industry, secRel)
 			}
 			if list != nil {
-				// for _, v := range *list {
-				// 	for n, m := range *secRel {
-				// 		if util.ObjToString(v["_id"]) == util.ObjToString(m["_id"]) {
-				// 			*secRel = append((*secRel)[0:n], (*secRel)[n+1:]...)
-				// 			break
-				// 		}
-				// 	}
-				// }
-				// *list = append(*list, *secRel...)
 				list = public.MapArrSortMerge(*list, *secRel, "_id", "publishtime")
 			} else {
 				list = secRel

+ 4 - 33
src/jfw/front/swordfish.go

@@ -492,16 +492,9 @@ func (m *Front) PcAjaxReq() {
 				if list != nil {
 					listSize = len(*list)
 				}
-				if len([]rune(s_word)) > 3 && int(count) < pc_pageSize && start == 0 {
+				if len([]rune(s_word)) > 3 && int(count) < pc_pageSize && start == 0 && selectType == "title" {
 					secondKWS = jy.HttpEs(s_word, "ik_smart", config.Sysconfig["elasticsearch"].(string))
-					// 移动端数据导出改
-					//findfields := `"title"`
-					findfields := `"`
-					findfields += m.GetString("selectType")
-					findfields += `"`
-					if findfields == `"all"` {
-						findfields = `"title","detail"`
-					}
+					findfields := `"title"`
 					qstr := getSearchQuery(secondKWS, industry, minprice, maxprice, findfields, getBidSearchQuery(area, publishtime, subtype))
 					secondLimit := 2*pc_pageSize - int(count)
 					secRel := elastic.GetAllByNgram(INDEX, TYPE, qstr, findfields, bidSearch_sort, bidSearch_field, 0, secondLimit, 0, false)
@@ -509,15 +502,6 @@ func (m *Front) PcAjaxReq() {
 						public.BidListConvert(industry, secRel)
 					}
 					if list != nil {
-						// for _, v := range *list {
-						// 	for n, m := range *secRel {
-						// 		if util.ObjToString(v["_id"]) == util.ObjToString(m["_id"]) {
-						// 			*secRel = append((*secRel)[0:n], (*secRel)[n+1:]...)
-						// 			break
-						// 		}
-						// 	}
-						// }
-						// *list = append(*list, *secRel...)
 						list = public.MapArrSortMerge(*list, *secRel, "_id", "publishtime")
 					} else {
 						list = secRel
@@ -752,7 +736,7 @@ func getLastNewsQuery(area, publishtime, subtype, industry string) string {
 			starttime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Unix())
 		} else if publishtime == "thisyear" { //去年
 			starttime = fmt.Sprint(time.Date(now.Year()-1, 1, 1, 0, 0, 0, 0, time.Local).Unix())
-			endtime = fmt.Sprint(time.Date(now.Year(), 1, 1, 0, 0, 0, 0, time.Local).Unix())
+			endtime = fmt.Sprint(time.Date(now.Year()-1, 12, 31, 23, 59, 59, 0, time.Local).Unix())
 		} else {
 			starttime = strings.Split(publishtime, "_")[0]
 			endtime = strings.Split(publishtime, "_")[1]
@@ -875,14 +859,10 @@ func (m *Front) WxsearchlistPaging() {
 				if list != nil {
 					listSize = len(*list)
 				}
-				if len([]rune(s_word)) > 3 && listSize < pc_pageSize && pageNum == 1 {
+				if len([]rune(s_word)) > 3 && listSize < pc_pageSize && pageNum == 1 && selectType == "title" {
 					secondKWS = jy.HttpEs(s_word, "ik_smart", config.Sysconfig["elasticsearch"].(string))
 					findfields := `"title"`
 					qstr := getSearchQuery(secondKWS, industry, minprice, maxprice, findfields, getBidSearchQuery(scope, publishtime, subtype))
-					//					var secondCount int64 = 0
-					//					if qstr != "" {
-					//						secondCount = elastic.Count(INDEX, TYPE, qstr)
-					//					}
 					secondLimit := 2*pc_pageSize - listSize
 					secRel = elastic.GetAllByNgram(INDEX, TYPE, qstr, findfields, bidSearch_sort, filed, 0, secondLimit, 0, false)
 					if secRel != nil && len(*secRel) > 0 {
@@ -891,15 +871,6 @@ func (m *Front) WxsearchlistPaging() {
 							v["_id"] = util.EncodeArticleId2ByCheck(util.ObjToString(v["_id"]))
 						}
 						if list != nil {
-							// for _, v := range *list {
-							// 	for n, m := range *secRel {
-							// 		if util.ObjToString(v["_id"]) == util.ObjToString(m["_id"]) {
-							// 			*secRel = append((*secRel)[0:n], (*secRel)[n+1:]...)
-							// 			break
-							// 		}
-							// 	}
-							// }
-							// *list = append(*list, *secRel...)
 							list = public.MapArrSortMerge(*list, *secRel, "_id", "publishtime")
 						} else {
 							list = secRel

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

@@ -268,7 +268,6 @@ func (w *WsDataExport) ToCreateOrderPage() error {
 	//	w.DelSession("DataExportVerifyPhone_val")
 	email := w.GetSession("DataExportVerifyEmail_val")
 	resPhone := w.GetSession("DataExportVerifyPhone_val")
-	log.Println(util.Int64All(w.GetSession("CreatEVerifyTime")), "----", time.Now().Unix())
 	if email != nil {
 		lastSendDEVerify := util.Int64All(w.GetSession("CreatEVerifyTime"))
 		timeSpaceing := lastSendDEVerify - time.Now().Unix() + 60*5

+ 2 - 18
src/jfw/modules/app/src/app/front/swordfish.go

@@ -468,16 +468,9 @@ func (m *Front) WxsearchlistPaging() {
 				if list != nil {
 					listSize = len(*list)
 				}
-				if len([]rune(s_word)) > 3 && listSize < wx_pageSize && pageNum == 1 {
+				if len([]rune(s_word)) > 3 && listSize < wx_pageSize && pageNum == 1 && selectType == "title" {
 					secondKWS = jy.HttpEs(searchvalue, "ik_smart", config.Sysconfig["elasticsearch"].(string))
-					// 移动端数据导出改
-					//findfields := `"title"`
-					findfields := `"`
-					findfields += m.GetString("selectType")
-					findfields += `"`
-					if findfields == `"all"` {
-						findfields = `"title","detail"`
-					}
+					findfields := `"title"`
 					qstr := getSearchQuery(secondKWS, industry, minprice, maxprice, findfields, getBidSearchQuery(scope, publishtime, subtype))
 					secondLimit := 2*wx_pageSize - listSize
 					secRel = elastic.GetAllByNgram(INDEX, TYPE, qstr, findfields, bidSearch_sort, feld, 0, secondLimit, 0, false)
@@ -487,15 +480,6 @@ func (m *Front) WxsearchlistPaging() {
 							v["_id"] = util.EncodeArticleId2ByCheck(util.ObjToString(v["_id"]))
 						}
 						if list != nil {
-							// for _, v := range *list {
-							// 	for n, m := range *secRel {
-							// 		if util.ObjToString(v["_id"]) == util.ObjToString(m["_id"]) {
-							// 			*secRel = append((*secRel)[0:n], (*secRel)[n+1:]...)
-							// 			break
-							// 		}
-							// 	}
-							// }
-							// *list = append(*list, *secRel...)
 							list = public.MapArrSortMerge(*list, *secRel, "_id", "publishtime")
 						} else {
 							list = secRel

+ 5 - 5
src/jfw/public/search.go

@@ -272,7 +272,7 @@ func GetDataExportSearchCountUseId(_id string) (count int) {
 	count = int(elastic.Count(INDEX, TYPE, qstr))
 	//超级搜索一致的检索(防止数据导出和超级搜索数据量不一致)
 	//if scd.Comeinfrom == "supersearchPage" || scd.Comeinfrom == "exportPage" {
-	if len(scd.Keyword) != 0 {
+	if len(scd.Keyword) != 0 && scd.SelectType == "title" {
 		searchTextSize := 0
 		if len(scd.Keyword) > 0 {
 			searchTextSize = len([]rune(scd.Keyword[0].Keyword))
@@ -338,7 +338,7 @@ func GetDataExportSearchResultUseId(_id, dataType string, count int) *[]map[stri
 
 	if count == -1 {
 		//数据预览数据查询
-		if (scd.Comeinfrom == "supersearchPage" && len(scd.Keyword) == 0 && len(scd.Industry) == 0) || (scd.Comeinfrom != "supersearchPage" && isNullSearch(scd)) {
+		if scd.Comeinfrom == "supersearchPage" && len(scd.Keyword) == 0 && len(scd.Industry) == 0 {
 			//空查询
 			obj := redis.Get("other", "export_news")
 			if obj != nil {
@@ -357,7 +357,7 @@ func GetDataExportSearchResultUseId(_id, dataType string, count int) *[]map[stri
 			if len(scd.Keyword) > 0 {
 				searchTextSize = len([]rune(scd.Keyword[0].Keyword))
 			}
-			if searchTextSize > 3 && count < 50 {
+			if searchTextSize > 3 && count < 50 && scd.SelectType == "title" {
 				var res *[]map[string]interface{}
 				if count > 0 {
 					res = doSearch(qstr, 0, count, "")
@@ -409,7 +409,7 @@ func GetDataExportSearchResultUseId(_id, dataType string, count int) *[]map[stri
 			if len(scd.Keyword) > 0 {
 				searchTextSize = len([]rune(scd.Keyword[0].Keyword))
 			}
-			if searchTextSize > 3 && num < 50 {
+			if searchTextSize > 3 && num < 50 && scd.SelectType == "title" {
 				secondKWS := jy.HttpEs(scd.Keyword[0].Keyword, "ik_smart", config.Sysconfig["elasticsearch"].(string))
 				scd.Keyword[0].Keyword = secondKWS
 				qstr = getDataExportSql(scd)
@@ -516,7 +516,7 @@ func doSearch(sql string, start, count int, dataType string) *[]map[string]inter
 		//分页排序
 		sql = sql[:len(sql)-1] + `,"sort": {"publishtime":"desc"},"from":` + strconv.Itoa(start) + `,"size":` + strconv.Itoa(count) + "}"
 	}
-	log.Println("sql----", sql)
+	//	log.Println("sql----", sql)
 
 	return elastic.Get(INDEX, TYPE, sql)
 }