|
@@ -307,7 +307,7 @@ func PublicSearch(userId, selectType, publishtime string, bidSearchOldUserLimit
|
|
|
}
|
|
|
|
|
|
//所有的再次分词查询 只查标题
|
|
|
-func IntegratedData(stype int, s_word, secondKWS, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, secondFlag, area, publishtime, subtype, buyerclass, notkey string, queryItems []string, list *[]map[string]interface{}) (string, string, string, string) {
|
|
|
+func IntegratedData(platform string, s_word, secondKWS, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, secondFlag, area, publishtime, subtype, buyerclass, notkey string, queryItems []string, list *[]map[string]interface{}) (string, string, string, string) {
|
|
|
var pcAjaxFlag string
|
|
|
secondSearch := false
|
|
|
for _, item := range queryItems {
|
|
@@ -323,7 +323,7 @@ func IntegratedData(stype int, s_word, secondKWS, industry, minprice, maxprice,
|
|
|
secRel := elastic.GetAllByNgram(INDEX, TYPE, qstr, findfields, bidSearch_sort, bidSearch_field, 0, 2*SearchPageSize_PC, 0, false)
|
|
|
if secRel != nil && len(*secRel) > 0 {
|
|
|
public.BidListConvert(industry, secRel)
|
|
|
- if stype == 3 || stype == 4 {
|
|
|
+ if platform == "app" || platform == "wx" {
|
|
|
for _, v := range *secRel {
|
|
|
v["_id"] = util.EncodeArticleId2ByCheck(util.ObjToString(v["_id"]))
|
|
|
}
|
|
@@ -432,21 +432,12 @@ func LisetData(stype, pageNum int, list *[]map[string]interface{}, secondFlag st
|
|
|
return secondList, totalPage, hasNextPage
|
|
|
}
|
|
|
|
|
|
-//1 2 pc 3 app 4 wx
|
|
|
-func SearchData(stype int, request *http.Request, currentPage int, userId, secondKWS, s_word, area, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel string, start, pageSize int, isGetCount bool, queryItems []string, field, notkey string, isPayedUser bool) (second, b_word, a_word, pcAjaxFlag, secondFlag string, count, totalPage int64, list *[]map[string]interface{}) {
|
|
|
- var (
|
|
|
- platform string
|
|
|
- searchvalue = s_word
|
|
|
- )
|
|
|
- number := util.If(stype == 3 || stype == 4, 1, 0)
|
|
|
- if stype == 3 {
|
|
|
- platform = "app"
|
|
|
- list, b_word, a_word, s_word = GetWxsearchlistData(s_word, area, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel, start, SearchPageSize_APP, queryItems, field, notkey)
|
|
|
- } else if stype == 4 {
|
|
|
- platform = "wx"
|
|
|
+func SearchData(platform string, request *http.Request, currentPage int, userId, secondKWS, s_word, area, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel string, start, pageSize int, isGetCount bool, queryItems []string, field, notkey string, isPayedUser bool) (second, b_word, a_word, pcAjaxFlag, secondFlag string, count, totalPage int64, list *[]map[string]interface{}) {
|
|
|
+ var searchvalue = s_word
|
|
|
+ number := util.If(platform == "app" || platform == "wx", 1, 0)
|
|
|
+ if platform == "app" || platform == "wx" {
|
|
|
list, b_word, a_word, s_word = GetWxsearchlistData(s_word, area, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel, start, SearchPageSize_APP, queryItems, field, notkey)
|
|
|
} else {
|
|
|
- platform = "pc"
|
|
|
count, totalPage, list = GetPcBidSearchData(s_word, area, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel, start, pageSize, isGetCount, queryItems, field, notkey, isPayedUser)
|
|
|
}
|
|
|
|
|
@@ -455,10 +446,10 @@ func SearchData(stype int, request *http.Request, currentPage int, userId, secon
|
|
|
listSize = len(*list)
|
|
|
}
|
|
|
if len([]rune(s_word)) > 3 && int(count) < SearchPageSize_PC && start == number {
|
|
|
- s_word, pcAjaxFlag, secondFlag, second = IntegratedData(stype, s_word, secondKWS, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, secondFlag, area, publishtime, subtype, buyerclass, notkey, queryItems, list)
|
|
|
+ s_word, pcAjaxFlag, secondFlag, second = IntegratedData(platform, s_word, secondKWS, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, secondFlag, area, publishtime, subtype, buyerclass, notkey, queryItems, list)
|
|
|
}
|
|
|
public.SaveUserSearchLog(request, userId, -1, platform, "超级搜索", map[string]interface{}{
|
|
|
- "search_word": util.If(stype == 3 || stype == 4, searchvalue, s_word),
|
|
|
+ "search_word": util.If(platform == "app" || platform == "wx", searchvalue, s_word),
|
|
|
"search_area": area,
|
|
|
"search_price": []string{minprice, maxprice},
|
|
|
"search_publishtime": publishtime,
|