Kaynağa Gözat

fix:修改查询限制翻页

wangkaiyue 3 yıl önce
ebeveyn
işleme
ffe78bf589

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

@@ -420,7 +420,6 @@ func (p *Pcsearch) PcSearchIndex() error {
 		}
 	}
 	p.T["login"] = p.Session().Get("user")
-	log.Println("xxxx", count, totalPage)
 	p.T["count"] = count
 	p.T["totalPage"] = totalPage
 	p.T["keywords"] = b_word

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

@@ -160,27 +160,14 @@ func (m *Front) PcAjaxReq() {
 		} else if reqType == "bidSearch" {
 			//全文检索限制
 			if searchLimit {
-				limitFlag = public.Lst.Flag
+				//limitFlag = public.Lst.Flag
 				isLimit = public.Lst.IsLimited(m.Request, m.ResponseWriter, m.Session(), isPayedUser)
 				if isLimit == 1 { //没有被限制
 					defer public.Lst.Limit()
 				}
 			}
 			if isLimit == 1 {
-				if limitFlag {
-					if start == 0 {
-						limit_count := public.Lst.TotalPage * bidsearch.SearchPageSize_PC
-						count, totalPage, list = bidsearch.GetPcBidSearchData(s_word, area, publishtime, subtype, industry, minprice, maxprice, "", buyerclass, hasBuyerTel, hasWinnerTel, 0, limit_count, true, queryItems, field, notkey, isPayedUser)
-						if totalPage > int64(public.Lst.TotalPage) {
-							totalPage = int64(public.Lst.TotalPage)
-						}
-						if count > int64(limit_count) {
-							count = int64(limit_count)
-						}
-					}
-				} else {
-					count, totalPage, list = bidsearch.GetPcBidSearchData(s_word, area, publishtime, subtype, industry, minprice, maxprice, "", buyerclass, hasBuyerTel, hasWinnerTel, start, bidsearch.SearchPageSize_PC, true, queryItems, field, notkey, isPayedUser)
-				}
+				count, totalPage, list = bidsearch.GetPcBidSearchData(s_word, area, publishtime, subtype, industry, minprice, maxprice, "", buyerclass, hasBuyerTel, hasWinnerTel, start, bidsearch.SearchPageSize_PC, true, queryItems, field, notkey, isPayedUser)
 				listSize := 0
 				if list != nil {
 					listSize = len(*list)
@@ -480,20 +467,14 @@ func (m *Front) WxsearchlistPaging() {
 			//全文检索限制
 			searchLimit := public.IsSearchLimit(queryItems)
 			if searchLimit {
-				limitFlag = public.Lst.Flag
+				//limitFlag = public.Lst.Flag
 				isLimit = public.Lst.IsLimited(m.Request, m.ResponseWriter, m.Session(), isPayedUser)
 				if isLimit == 1 { //没有被限制
 					defer public.Lst.Limit()
 				}
 			}
 			if isLimit == 1 {
-				if limitFlag {
-					if pageNum == 1 {
-						list, b_word, a_word, s_word = bidsearch.GetWxsearchlistData(searchvalue, scope, publishtime, subtype, industry, minprice, maxprice, "", buyerclass, hasBuyerTel, hasWinnerTel, pageNum, public.Lst.TotalPage*bidsearch.SearchPageSize_WX, queryItems, filed, notkey)
-					}
-				} else {
-					list, b_word, a_word, s_word = bidsearch.GetWxsearchlistData(searchvalue, scope, publishtime, subtype, industry, minprice, maxprice, "", buyerclass, hasBuyerTel, hasWinnerTel, pageNum, bidsearch.SearchPageSize_WX, queryItems, filed, notkey)
-				}
+				list, b_word, a_word, s_word = bidsearch.GetWxsearchlistData(searchvalue, scope, publishtime, subtype, industry, minprice, maxprice, "", buyerclass, hasBuyerTel, hasWinnerTel, pageNum, bidsearch.SearchPageSize_WX, queryItems, filed, notkey)
 				listSize := 0
 				if list != nil {
 					listSize = len(*list)
@@ -568,8 +549,6 @@ func (m *Front) WxsearchlistPaging() {
 				hasNextPage = false
 			} else if !isPayedUser && pageNum >= bidsearch.SearchMaxPageNum_WX {
 				hasNextPage = false
-			} else if limitFlag {
-				hasNextPage = false
 			}
 		}
 		if one != nil && len(*one) > 0 {

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

@@ -291,7 +291,7 @@ func (m *Front) WxsearchlistPaging() {
 			//全文检索限制
 			searchLimit := public.IsSearchLimit(queryItems)
 			if searchLimit {
-				limitFlag = public.Lst.Flag
+				//limitFlag = public.Lst.Flag
 				isLimit = public.Lst.IsLimited(m.Request, m.ResponseWriter, m.Session(), isPayedUser)
 				if isLimit == 1 { //没有被限制
 					defer public.Lst.Limit()
@@ -304,13 +304,7 @@ func (m *Front) WxsearchlistPaging() {
 			}
 			if isLimit == 1 {
 				s_word := ""
-				if limitFlag {
-					if pageNum == 1 {
-						list, b_word, a_word, s_word = bidsearch.GetWxsearchlistData(searchvalue, scope, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel, pageNum, public.Lst.TotalPage*bidsearch.SearchPageSize_APP, queryItems, feld, notkey)
-					}
-				} else {
-					list, b_word, a_word, s_word = bidsearch.GetWxsearchlistData(searchvalue, scope, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel, pageNum, bidsearch.SearchPageSize_APP, queryItems, feld, notkey)
-				}
+				list, b_word, a_word, s_word = bidsearch.GetWxsearchlistData(searchvalue, scope, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel, pageNum, bidsearch.SearchPageSize_APP, queryItems, feld, notkey)
 				listSize := 0
 				if list != nil {
 					listSize = len(*list)

+ 1 - 1
src/jfw/public/limitSearchText.go

@@ -25,7 +25,7 @@ type LimitSearchText struct {
 
 func IsSearchLimit(searchItems []string) bool {
 	for _, searchItem := range searchItems {
-		if searchItem == "content" || searchItem == "filetext" {
+		if searchItem == "detail" || searchItem == "filetext" {
 			return true
 		}
 	}