|
@@ -114,15 +114,15 @@ func (m *Front) PcAjaxReq() {
|
|
|
isPayedUser := vipStatus.IsPayedUser()
|
|
|
queryItems := vipStatus.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
|
|
|
if isPayedUser {
|
|
|
- if currentPage > bidsearch.SearchMaxPageNum_PayUser {
|
|
|
- currentPage = bidsearch.SearchMaxPageNum_PayUser
|
|
|
+ if currentPage > bidsearch.SearchMaxPageNum_PAYED {
|
|
|
+ currentPage = bidsearch.SearchMaxPageNum_PAYED
|
|
|
}
|
|
|
buyerclass = m.GetString("buyerclass")
|
|
|
hasBuyerTel, hasWinnerTel = m.GetString("buyertel"), m.GetString("winnertel")
|
|
|
notkey = m.GetString("notkey")
|
|
|
} else {
|
|
|
- if currentPage > bidsearch.SearchMaxPageNum_PC {
|
|
|
- currentPage = bidsearch.SearchMaxPageNum_PC
|
|
|
+ if currentPage > bidsearch.SearchMaxPageNum_PAYED {
|
|
|
+ currentPage = bidsearch.SearchMaxPageNum_PAYED
|
|
|
}
|
|
|
//时间自定义选择默认是vip 大会员 等权限
|
|
|
if len(strings.Split(publishtime, "_")) == 2 {
|
|
@@ -420,26 +420,28 @@ func (m *Front) WxsearchlistPaging() {
|
|
|
userId, _ := m.GetSession("userId").(string)
|
|
|
var list *[]map[string]interface{}
|
|
|
var secRel *[]map[string]interface{}
|
|
|
+ var b_word, a_word, s_word, secondFlag, secondKWS string
|
|
|
+ var secondList []map[string]interface{}
|
|
|
+ var limitFlag, hasNextPage bool
|
|
|
+ isLimit := 1
|
|
|
pageNum, _ := m.GetInteger("pageNum")
|
|
|
- if userId != "" && pageNum <= bidsearch.SearchMaxPageNum_PAYED {
|
|
|
+ var keys []interface{}
|
|
|
+ var arrs []string
|
|
|
+ func() {
|
|
|
+ if userId == "" {
|
|
|
+ return
|
|
|
+ }
|
|
|
//历史记录和订阅查询
|
|
|
one, _ := mongodb.FindById("user", userId, `{"o_jy":1}`)
|
|
|
history := redis.GetStr("other", "s_"+userId)
|
|
|
- arrs := strings.Split(history, ",")
|
|
|
+ arrs = strings.Split(history, ",")
|
|
|
searchvalue := strings.TrimSpace(m.GetString("searchvalue"))
|
|
|
- var b_word, a_word string
|
|
|
- isLimit := 1
|
|
|
- limitFlag := false
|
|
|
- secondKWS := ""
|
|
|
- secondFlag := ""
|
|
|
isPayedUser := false
|
|
|
var secondList []map[string]interface{}
|
|
|
if searchvalue != "" {
|
|
|
- filed := ""
|
|
|
+ filed := bidSearch_field_1
|
|
|
if pageNum == 1 {
|
|
|
filed = bidSearch_field
|
|
|
- } else {
|
|
|
- filed = bidSearch_field_1
|
|
|
}
|
|
|
selectType := m.GetString("selectType")
|
|
|
subtype := m.GetString("subtype")
|
|
@@ -458,13 +460,16 @@ func (m *Front) WxsearchlistPaging() {
|
|
|
isPayedUser = vipStatus.IsPayedUser()
|
|
|
queryItems := vipStatus.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
|
|
|
if isPayedUser {
|
|
|
+ if pageNum > bidsearch.SearchMaxPageNum_PAYED {
|
|
|
+ return
|
|
|
+ }
|
|
|
buyerclass = m.GetString("buyerclass")
|
|
|
hasBuyerTel, hasWinnerTel = m.GetString("buyertel"), m.GetString("winnertel")
|
|
|
notkey = m.GetString("notkey")
|
|
|
} else {
|
|
|
//免费用户最多500条数据
|
|
|
if pageNum > bidsearch.SearchMaxPageNum_WX {
|
|
|
- pageNum = bidsearch.SearchMaxPageNum_WX
|
|
|
+ return
|
|
|
}
|
|
|
//时间自定义选择默认是vip 大会员 等权限
|
|
|
if len(strings.Split(publishtime, "_")) == 2 {
|
|
@@ -482,7 +487,6 @@ 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, "", buyerclass, hasBuyerTel, hasWinnerTel, pageNum, public.Lst.TotalPage*bidsearch.SearchPageSize_WX, queryItems, filed, notkey)
|
|
@@ -557,38 +561,40 @@ func (m *Front) WxsearchlistPaging() {
|
|
|
}
|
|
|
redis.Del("other", "s_"+userId)
|
|
|
redis.Put("other", "s_"+userId, strings.Join(arrs, ","), -1)
|
|
|
+ if list != nil && len(*list) == bidsearch.SearchPageSize_WX {
|
|
|
+ hasNextPage = true
|
|
|
+ }
|
|
|
+ if isPayedUser && pageNum >= bidsearch.SearchMaxPageNum_PAYED {
|
|
|
+ hasNextPage = false
|
|
|
+ } else if !isPayedUser && pageNum >= bidsearch.SearchMaxPageNum_WX {
|
|
|
+ hasNextPage = false
|
|
|
+ } else if limitFlag {
|
|
|
+ hasNextPage = false
|
|
|
+ }
|
|
|
}
|
|
|
- m.T["history"] = arrs
|
|
|
-
|
|
|
if one != nil && len(*one) > 0 {
|
|
|
o_jy, _ := (*one)["o_jy"].(map[string]interface{})
|
|
|
a_key, _ := o_jy["a_key"].([]interface{})
|
|
|
- var keys []interface{}
|
|
|
for _, v := range a_key {
|
|
|
keyMap, _ := v.(map[string]interface{})
|
|
|
key, _ := keyMap["key"].([]interface{})
|
|
|
keys = append(keys, key)
|
|
|
}
|
|
|
- m.T["msgset"] = keys
|
|
|
}
|
|
|
- hasNextPage := list != nil && len(*list) == bidsearch.SearchPageSize_WX && pageNum < util.If(isPayedUser, bidsearch.SearchMaxPageNum_PAYED, bidsearch.SearchMaxPageNum_WX).(int)
|
|
|
- if limitFlag {
|
|
|
- hasNextPage = false
|
|
|
- }
|
|
|
- m.ServeJson(map[string]interface{}{
|
|
|
- "limitFlag": limitFlag,
|
|
|
- "status": isLimit,
|
|
|
- "list": list,
|
|
|
- "hasNextPage": hasNextPage,
|
|
|
- "history": m.T["history"],
|
|
|
- "msgset": m.T["msgset"],
|
|
|
- "interceptWord": a_word,
|
|
|
- "keyWord": b_word,
|
|
|
- "secondFlag": secondFlag,
|
|
|
- "secondList": secondList,
|
|
|
- "secondKWS": secondKWS,
|
|
|
- })
|
|
|
- }
|
|
|
+ }()
|
|
|
+ m.ServeJson(map[string]interface{}{
|
|
|
+ "limitFlag": limitFlag,
|
|
|
+ "status": isLimit,
|
|
|
+ "list": list,
|
|
|
+ "hasNextPage": hasNextPage,
|
|
|
+ "history": arrs,
|
|
|
+ "msgset": keys,
|
|
|
+ "interceptWord": a_word,
|
|
|
+ "keyWord": b_word,
|
|
|
+ "secondFlag": secondFlag,
|
|
|
+ "secondList": secondList,
|
|
|
+ "secondKWS": secondKWS,
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
//微信端删除历史搜索
|