wangchuanjin 5 years ago
parent
commit
17fac993b2

+ 6 - 3
src/jfw/front/supsearch.go

@@ -278,8 +278,7 @@ func (p *Pcsearch) PcSearchIndex() error {
 			secondKWS = jy.HttpEs(s_word, "ik_smart", public.DbConf.Elasticsearch.Main.Address)
 			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)
+			secRel := elastic.GetAllByNgram(INDEX, TYPE, qstr, findfields, bidSearch_sort, bidSearch_field, 0, 2*pc_pageSize, 0, false)
 			if secRel != nil {
 				public.BidListConvert(industry, secRel)
 			}
@@ -334,8 +333,12 @@ func (p *Pcsearch) PcSearchIndex() error {
 			p.T["list"] = list
 		} else {
 			if len(*list) > pc_pageSize {
+				secondList := (*list)[pc_pageSize:]
+				if len(secondList) > pc_pageSize {
+					secondList = secondList[:pc_pageSize]
+				}
+				p.T["secondList"] = secondList
 				p.T["list"] = (*list)[:pc_pageSize]
-				p.T["secondList"] = (*list)[pc_pageSize:]
 			} else {
 				p.T["list"] = list
 				p.T["secondList"] = ""

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

@@ -508,8 +508,7 @@ func (m *Front) PcAjaxReq() {
 					secondKWS = jy.HttpEs(s_word, "ik_smart", public.DbConf.Elasticsearch.Main.Address)
 					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)
+					secRel := elastic.GetAllByNgram(INDEX, TYPE, qstr, findfields, bidSearch_sort, bidSearch_field, 0, 2*pc_pageSize, 0, false)
 					if secRel != nil {
 						public.BidListConvert(industry, secRel)
 					}
@@ -565,6 +564,9 @@ func (m *Front) PcAjaxReq() {
 		if secondFlag != "" {
 			if len(*list) > pc_pageSize {
 				secondList = (*list)[pc_pageSize:]
+				if len(secondList) > pc_pageSize {
+					secondList = secondList[:pc_pageSize]
+				}
 				*list = (*list)[:pc_pageSize]
 				totalPage = 2
 			} else {
@@ -875,8 +877,7 @@ func (m *Front) WxsearchlistPaging() {
 					secondKWS = jy.HttpEs(s_word, "ik_smart", public.DbConf.Elasticsearch.Main.Address)
 					findfields := `"title"`
 					qstr := getSearchQuery(secondKWS, industry, minprice, maxprice, findfields, getBidSearchQuery(scope, publishtime, subtype))
-					secondLimit := 2*pc_pageSize - listSize
-					secRel = elastic.GetAllByNgram(INDEX, TYPE, qstr, findfields, bidSearch_sort, filed, 0, secondLimit, 0, false)
+					secRel = elastic.GetAllByNgram(INDEX, TYPE, qstr, findfields, bidSearch_sort, filed, 0, 2*pc_pageSize, 0, false)
 					if secRel != nil && len(*secRel) > 0 {
 						public.BidListConvert(industry, secRel)
 						for _, v := range *secRel {
@@ -890,6 +891,9 @@ func (m *Front) WxsearchlistPaging() {
 						secondFlag = "T"
 						if len(*list) > pc_pageSize && selectType == "title" {
 							secondList = (*list)[pc_pageSize:]
+							if len(secondList) > pc_pageSize {
+								secondList = secondList[:pc_pageSize]
+							}
 							*list = (*list)[:pc_pageSize]
 						}
 					} else {

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

@@ -473,8 +473,7 @@ func (m *Front) WxsearchlistPaging() {
 					secondKWS = jy.HttpEs(s_word, "ik_smart", public.DbConf.Elasticsearch.Main.Address)
 					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)
+					secRel = elastic.GetAllByNgram(INDEX, TYPE, qstr, findfields, bidSearch_sort, feld, 0, 2*wx_pageSize, 0, false)
 					if secRel != nil && len(*secRel) > 0 {
 						public.BidListConvert(industry, secRel)
 						for _, v := range *secRel {
@@ -488,6 +487,9 @@ func (m *Front) WxsearchlistPaging() {
 						secondFlag = "T"
 						if len(*list) > wx_pageSize && selectType == "title" {
 							secondList = (*list)[wx_pageSize:]
+							if len(secondList) > wx_pageSize {
+								secondList = secondList[:wx_pageSize]
+							}
 							*list = (*list)[:wx_pageSize]
 						}
 					} else {

+ 1 - 1
src/jfw/modules/app/src/dataexport.json

@@ -5,7 +5,7 @@
         "convertVersionDefault": "1.0",
         "unConvertVersionDefault": "top111",
         "mappingFileExt": ".mapping",
-        "mappingFilePath": "web/staticres/fonts/ttf/mapping/",
+        "mappingFilePath": "web/staticres/jyapp/fonts/ttf/mapping/",
         "redisPool": "other",
         "redisKey": "fontVersion"
     }

+ 1 - 1
src/jfw/modules/app/src/web/templates/course/paySuccess.html

@@ -10,7 +10,7 @@
     <meta http-equiv="X-UA-Compatible" content="ie=edge">
     <meta http-equiv="X-UA-Compatible" content="ie=edge">
     <title>支付结果</title>
-    <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/rem.js}"></script>
+    <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/rem.js"></script>
     <link rel="stylesheet" type="text/css" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/weui.min.css">
     <link rel="stylesheet" type="text/css" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/course/css/base.css?v={{Msg "seo" "version"}}" />
     <link rel="stylesheet" type="text/css" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/course/iconfont/iconfont.css?v={{Msg "seo" "version"}}" />

+ 8 - 0
src/jfw/modules/app/src/web/templates/dataExport/dataExport_previewData.html

@@ -11,6 +11,14 @@
 		<script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/jquery.min.js"></script>
 		{{include "/common/js.html"}}
 		<style>
+      @font-face {
+				font-style: normal;
+			  font-weight: normal;
+				font-family: 'MyNewFont';
+				src: url('/jyapp/fonts/ttf/1.0_pc.eot');   
+    		src: url('/jyapp/fonts/ttf/1.0_pc.eot?#iefix') format('embedded-opentype'),  
+				  url("/jyapp/fonts/ttf/1.0_pc.ttf") format("truetype");
+			}
 			body{
 				-webkit-text-size-adjust: none;
 			}

+ 10 - 3
src/jfw/modules/subscribepay/src/entity/dataExportSearch.go

@@ -308,9 +308,13 @@ func GetDataExportSearchCountUseId(_id string) (count int) {
 				scd.Keyword[0].Keyword = secondKWS
 				scd.SelectType = "title"
 				qstr = getDataExportSql(scd)
-				res2 := doSearch(qstr, 0, 100-count, "")
+				res2 := doSearch(qstr, 0, 100, "")
 				log.Println(len(*res2))
-				return len(*delRepeatMapArr(res, res2))
+				result := len(*delRepeatMapArr(res, res2))
+				if result > 100 {
+					result = 100
+				}
+				return result
 			}
 			return
 		}
@@ -403,8 +407,11 @@ func GetDataExportSearchResultUseId(_id, dataType string, count int) (*[]map[str
 			scd.Keyword[0].Keyword = secondKWS
 			scd.SelectType = "title"
 			qstr = getDataExportSql(scd)
-			res2 := doSearch(qstr, 0, 100-num, "")
+			res2 := doSearch(qstr, 0, 100, "")
 			res = *delRepeatMapArr(&res, res2)
+			if len(res) > 100 {
+				res = res[:100]
+			}
 		}
 	}
 	var EntArr = []string{}

+ 11 - 3
src/jfw/public/search.go

@@ -289,9 +289,13 @@ func GetDataExportSearchCountUseId(_id string) (count int) {
 				scd.Keyword[0].Keyword = secondKWS
 				scd.SelectType = "title"
 				qstr = getDataExportSql(scd)
-				res2 := doSearch(qstr, 0, 100-count, "")
+				res2 := doSearch(qstr, 0, 100, "")
 				log.Println(len(*res2))
-				return len(*delRepeatMapArr(res, res2))
+				result := len(*delRepeatMapArr(res, res2))
+				if result > 100 {
+					result = 100
+				}
+				return result
 			}
 			return
 		}
@@ -371,7 +375,11 @@ func GetDataExportSearchResultUseId(_id, dataType string, count int) (*[]map[str
 			scd.Keyword[0].Keyword = secondKWS
 			scd.SelectType = "title"
 			qstr = getDataExportSql(scd)
-			res2 := doSearch(qstr, 0, 100-count, "")
+			res2 := doSearch(qstr, 0, 100, "")
+			if len(*res2) > 100 {
+				res2_temp := (*res2)[:100]
+				res2 = &res2_temp
+			}
 			return delRepeatMapArr(res, res2), kws
 		}
 	}