|
@@ -98,10 +98,6 @@ func (m *Front) PcAjaxReq() {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
currentPage, _ := m.GetInteger("pageNumber")
|
|
currentPage, _ := m.GetInteger("pageNumber")
|
|
- if currentPage > bidsearch.SearchMaxPageNum_PC {
|
|
|
|
- currentPage = bidsearch.SearchMaxPageNum_PC
|
|
|
|
- }
|
|
|
|
- start := (currentPage - 1) * bidsearch.SearchPageSize_PC
|
|
|
|
area := m.GetString("area")
|
|
area := m.GetString("area")
|
|
subtype := m.GetString("subtype")
|
|
subtype := m.GetString("subtype")
|
|
publishtime := m.GetString("publishtime")
|
|
publishtime := m.GetString("publishtime")
|
|
@@ -118,16 +114,22 @@ func (m *Front) PcAjaxReq() {
|
|
isPayedUser := vipStatus.IsPayedUser()
|
|
isPayedUser := vipStatus.IsPayedUser()
|
|
queryItems := vipStatus.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
|
|
queryItems := vipStatus.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
|
|
if isPayedUser {
|
|
if isPayedUser {
|
|
|
|
+ if currentPage > bidsearch.SearchMaxPageNum_PAYED {
|
|
|
|
+ currentPage = bidsearch.SearchMaxPageNum_PAYED
|
|
|
|
+ }
|
|
buyerclass = m.GetString("buyerclass")
|
|
buyerclass = m.GetString("buyerclass")
|
|
hasBuyerTel, hasWinnerTel = m.GetString("buyertel"), m.GetString("winnertel")
|
|
hasBuyerTel, hasWinnerTel = m.GetString("buyertel"), m.GetString("winnertel")
|
|
notkey = m.GetString("notkey")
|
|
notkey = m.GetString("notkey")
|
|
} else {
|
|
} else {
|
|
|
|
+ if currentPage > bidsearch.SearchMaxPageNum_PC {
|
|
|
|
+ currentPage = bidsearch.SearchMaxPageNum_PC
|
|
|
|
+ }
|
|
//时间自定义选择默认是vip 大会员 等权限
|
|
//时间自定义选择默认是vip 大会员 等权限
|
|
if len(strings.Split(publishtime, "_")) == 2 {
|
|
if len(strings.Split(publishtime, "_")) == 2 {
|
|
publishtime = ""
|
|
publishtime = ""
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ start := (currentPage - 1) * bidsearch.SearchPageSize_PC
|
|
m.SetSession("selectType", selectType)
|
|
m.SetSession("selectType", selectType)
|
|
//只有前20条 有全字段,
|
|
//只有前20条 有全字段,
|
|
if subtype != "拟建" && currentPage != 1 {
|
|
if subtype != "拟建" && currentPage != 1 {
|
|
@@ -418,26 +420,28 @@ func (m *Front) WxsearchlistPaging() {
|
|
userId, _ := m.GetSession("userId").(string)
|
|
userId, _ := m.GetSession("userId").(string)
|
|
var list *[]map[string]interface{}
|
|
var list *[]map[string]interface{}
|
|
var secRel *[]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")
|
|
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}`)
|
|
one, _ := mongodb.FindById("user", userId, `{"o_jy":1}`)
|
|
history := redis.GetStr("other", "s_"+userId)
|
|
history := redis.GetStr("other", "s_"+userId)
|
|
- arrs := strings.Split(history, ",")
|
|
|
|
|
|
+ arrs = strings.Split(history, ",")
|
|
searchvalue := strings.TrimSpace(m.GetString("searchvalue"))
|
|
searchvalue := strings.TrimSpace(m.GetString("searchvalue"))
|
|
- var b_word, a_word string
|
|
|
|
- isLimit := 1
|
|
|
|
- limitFlag := false
|
|
|
|
- secondKWS := ""
|
|
|
|
- secondFlag := ""
|
|
|
|
isPayedUser := false
|
|
isPayedUser := false
|
|
var secondList []map[string]interface{}
|
|
var secondList []map[string]interface{}
|
|
if searchvalue != "" {
|
|
if searchvalue != "" {
|
|
- filed := ""
|
|
|
|
|
|
+ filed := bidSearch_field_1
|
|
if pageNum == 1 {
|
|
if pageNum == 1 {
|
|
filed = bidSearch_field
|
|
filed = bidSearch_field
|
|
- } else {
|
|
|
|
- filed = bidSearch_field_1
|
|
|
|
}
|
|
}
|
|
selectType := m.GetString("selectType")
|
|
selectType := m.GetString("selectType")
|
|
subtype := m.GetString("subtype")
|
|
subtype := m.GetString("subtype")
|
|
@@ -456,13 +460,16 @@ func (m *Front) WxsearchlistPaging() {
|
|
isPayedUser = vipStatus.IsPayedUser()
|
|
isPayedUser = vipStatus.IsPayedUser()
|
|
queryItems := vipStatus.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
|
|
queryItems := vipStatus.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
|
|
if isPayedUser {
|
|
if isPayedUser {
|
|
|
|
+ if pageNum > bidsearch.SearchMaxPageNum_PAYED {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
buyerclass = m.GetString("buyerclass")
|
|
buyerclass = m.GetString("buyerclass")
|
|
hasBuyerTel, hasWinnerTel = m.GetString("buyertel"), m.GetString("winnertel")
|
|
hasBuyerTel, hasWinnerTel = m.GetString("buyertel"), m.GetString("winnertel")
|
|
notkey = m.GetString("notkey")
|
|
notkey = m.GetString("notkey")
|
|
} else {
|
|
} else {
|
|
//免费用户最多500条数据
|
|
//免费用户最多500条数据
|
|
if pageNum > bidsearch.SearchMaxPageNum_WX {
|
|
if pageNum > bidsearch.SearchMaxPageNum_WX {
|
|
- pageNum = bidsearch.SearchMaxPageNum_WX
|
|
|
|
|
|
+ return
|
|
}
|
|
}
|
|
//时间自定义选择默认是vip 大会员 等权限
|
|
//时间自定义选择默认是vip 大会员 等权限
|
|
if len(strings.Split(publishtime, "_")) == 2 {
|
|
if len(strings.Split(publishtime, "_")) == 2 {
|
|
@@ -480,7 +487,6 @@ func (m *Front) WxsearchlistPaging() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if isLimit == 1 {
|
|
if isLimit == 1 {
|
|
- s_word := ""
|
|
|
|
if limitFlag {
|
|
if limitFlag {
|
|
if pageNum == 1 {
|
|
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)
|
|
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)
|
|
@@ -555,38 +561,40 @@ func (m *Front) WxsearchlistPaging() {
|
|
}
|
|
}
|
|
redis.Del("other", "s_"+userId)
|
|
redis.Del("other", "s_"+userId)
|
|
redis.Put("other", "s_"+userId, strings.Join(arrs, ","), -1)
|
|
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 {
|
|
if one != nil && len(*one) > 0 {
|
|
o_jy, _ := (*one)["o_jy"].(map[string]interface{})
|
|
o_jy, _ := (*one)["o_jy"].(map[string]interface{})
|
|
a_key, _ := o_jy["a_key"].([]interface{})
|
|
a_key, _ := o_jy["a_key"].([]interface{})
|
|
- var keys []interface{}
|
|
|
|
for _, v := range a_key {
|
|
for _, v := range a_key {
|
|
keyMap, _ := v.(map[string]interface{})
|
|
keyMap, _ := v.(map[string]interface{})
|
|
key, _ := keyMap["key"].([]interface{})
|
|
key, _ := keyMap["key"].([]interface{})
|
|
keys = append(keys, key)
|
|
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,
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
//微信端删除历史搜索
|
|
//微信端删除历史搜索
|
|
@@ -633,7 +641,7 @@ func (m *Front) VisitRedirect() {
|
|
m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
|
|
m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
|
|
userId, _ := m.GetSession("userId").(string)
|
|
userId, _ := m.GetSession("userId").(string)
|
|
var obj map[string]interface{}
|
|
var obj map[string]interface{}
|
|
- obj = wxvisitD(sid, userId, myopenid)
|
|
|
|
|
|
+ obj = wxvisitD(sid, userId, myopenid, true)
|
|
if len(obj) > 0 {
|
|
if len(obj) > 0 {
|
|
//获取打赏文案
|
|
//获取打赏文案
|
|
m.T["rewardText"], m.T["advertText"] = getRewardText()
|
|
m.T["rewardText"], m.T["advertText"] = getRewardText()
|
|
@@ -645,7 +653,7 @@ func (m *Front) VisitRedirect() {
|
|
m.Redirect(surl)
|
|
m.Redirect(surl)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-func wxvisitD(sid, userId, openId string) (objdata map[string]interface{}) {
|
|
|
|
|
|
+func wxvisitD(sid, userId, openId string, isPayUser bool) (objdata map[string]interface{}) {
|
|
defer util.Catch()
|
|
defer util.Catch()
|
|
var obj map[string]interface{}
|
|
var obj map[string]interface{}
|
|
if len(sid) > 5 {
|
|
if len(sid) > 5 {
|
|
@@ -661,6 +669,13 @@ func wxvisitD(sid, userId, openId string) (objdata map[string]interface{}) {
|
|
obj = *aobj
|
|
obj = *aobj
|
|
}
|
|
}
|
|
if ok && obj != nil && len(obj) >= 3 {
|
|
if ok && obj != nil && len(obj) >= 3 {
|
|
|
|
+ if !isPayUser && (util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向") {
|
|
|
|
+ for k, _ := range obj {
|
|
|
|
+ if k != "title" && k != "area" && k != "subtype" && k != "toptype" && k != "publishtime" && k != "budget" && k != "bidamount" {
|
|
|
|
+ delete(obj, k)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
fwt := util.ObjToString(obj["subtype"])
|
|
fwt := util.ObjToString(obj["subtype"])
|
|
ltfd := getLowestField(fwt)
|
|
ltfd := getLowestField(fwt)
|
|
if ltfd != "" {
|
|
if ltfd != "" {
|
|
@@ -800,7 +815,7 @@ func (m *Front) PcVisitRedirect(sid string) {
|
|
if href != "" && !strings.HasPrefix(href, "http") {
|
|
if href != "" && !strings.HasPrefix(href, "http") {
|
|
href = "http://" + href
|
|
href = "http://" + href
|
|
}
|
|
}
|
|
- po, bo, wo, obj := pcVRT(sid, "")
|
|
|
|
|
|
+ po, bo, wo, obj := pcVRT(sid, "", true)
|
|
if obj != nil && len(obj) > 0 {
|
|
if obj != nil && len(obj) > 0 {
|
|
if len(po) > 0 {
|
|
if len(po) > 0 {
|
|
m.T["projectOther"] = po
|
|
m.T["projectOther"] = po
|
|
@@ -826,7 +841,7 @@ func (m *Front) PcVisitRedirect(sid string) {
|
|
|
|
|
|
//pc三级页跳转
|
|
//pc三级页跳转
|
|
//20170821增加查询字段s_subscopeclass
|
|
//20170821增加查询字段s_subscopeclass
|
|
-func pcVRT(sid, industry string) (po, bo, wo []map[string]interface{}, objdata map[string]interface{}) {
|
|
|
|
|
|
+func pcVRT(sid, industry string, isPayUser bool) (po, bo, wo []map[string]interface{}, objdata map[string]interface{}) {
|
|
defer util.Catch()
|
|
defer util.Catch()
|
|
var projectOther, buyerOther, winnerOther []map[string]interface{}
|
|
var projectOther, buyerOther, winnerOther []map[string]interface{}
|
|
var obj map[string]interface{}
|
|
var obj map[string]interface{}
|
|
@@ -843,6 +858,11 @@ func pcVRT(sid, industry string) (po, bo, wo []map[string]interface{}, objdata m
|
|
}
|
|
}
|
|
//obj, ok := elastic.GetByIdField("bidding", "bidding", sid, ""), true
|
|
//obj, ok := elastic.GetByIdField("bidding", "bidding", sid, ""), true
|
|
if ok && obj != nil && len(obj) > 0 {
|
|
if ok && obj != nil && len(obj) > 0 {
|
|
|
|
+ if !isPayUser && (util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向") {
|
|
|
|
+ delete(obj, "detail")
|
|
|
|
+ delete(obj, "projectinfo")
|
|
|
|
+
|
|
|
|
+ }
|
|
obj["_id"] = util.EncodeArticleId2ByCheck(sid)
|
|
obj["_id"] = util.EncodeArticleId2ByCheck(sid)
|
|
var infoformat = util.IntAllDef(obj["infoformat"], 1)
|
|
var infoformat = util.IntAllDef(obj["infoformat"], 1)
|
|
obj["infoformat"] = infoformat
|
|
obj["infoformat"] = infoformat
|
|
@@ -2108,20 +2128,13 @@ func (f *Front) HistorypushPaging() error {
|
|
|
|
|
|
//电脑端招标订阅
|
|
//电脑端招标订阅
|
|
func (m *Front) Subscribe() error {
|
|
func (m *Front) Subscribe() error {
|
|
- var shareid = m.GetString("id")
|
|
|
|
- if len(shareid) == 0 {
|
|
|
|
- shareid = "10" //fmt.Sprintf("%s%d", config.Seoconfig["jydyy"].(string)+fmt.Sprintf("%d", time.Now().UnixNano())[7:14], rand.Intn(9))
|
|
|
|
|
|
+ isBuyed := false
|
|
|
|
+ if userId, _ := m.GetSession("userId").(string); userId != "" {
|
|
|
|
+ vStatus := jy.GetVipState(public.Mysql, public.MQFW, userId)
|
|
|
|
+ isBuyed = vStatus.VipState > 0
|
|
}
|
|
}
|
|
|
|
+ m.T["isBuyed"] = isBuyed
|
|
m.T["logid"] = config.Seoconfig["jydyy"].(string)
|
|
m.T["logid"] = config.Seoconfig["jydyy"].(string)
|
|
- m.T["noshareid"] = shareid
|
|
|
|
- m.T["shareid"] = se.EncodeString(shareid)
|
|
|
|
- myopenid, _ := m.Session().Get("s_m_openid").(string)
|
|
|
|
- m.T["openid"] = se.EncodeString(myopenid)
|
|
|
|
- mynickname, _ := m.Session().Get("s_nickname").(string)
|
|
|
|
- myavatar, _ := m.Session().Get("s_avatar").(string)
|
|
|
|
- m.T["nickname"] = mynickname
|
|
|
|
- m.T["avatar"] = myavatar
|
|
|
|
- m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
|
|
|
|
return m.Render("/pc/subscribe_new.html", &m.T)
|
|
return m.Render("/pc/subscribe_new.html", &m.T)
|
|
}
|
|
}
|
|
|
|
|