|
@@ -113,6 +113,7 @@ func NewSearchOptimize(userId, phone, province, city, district, subtype, topType
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ log.Println("3333", userId, subtype, topType)
|
|
|
var so = &SearchOptimize{
|
|
|
AppId: "10000",
|
|
|
UserId: userId,
|
|
@@ -183,7 +184,7 @@ func (so *SearchOptimize) SearchParamsHandle() {
|
|
|
so.SearchGroup = 1
|
|
|
}
|
|
|
//信息类型
|
|
|
- if so.Subtype == "" && so.TopType == "" {
|
|
|
+ if so.Subtype == "" && so.TopType == "" && so.BidField != "BIProperty" {
|
|
|
// 所有用户都可以搜索,判断是否能使用超前项目 老版超级订阅、大会员、商机管理有权限
|
|
|
if so.SearchGroup > 0 && len(DefaultTopTypes) >= so.SearchGroup {
|
|
|
so.Subtype = DefaultTopTypes[so.SearchGroup-1]
|
|
@@ -352,7 +353,7 @@ func (so *SearchOptimize) GetBidSearchList(isCache bool) (count, total int64, li
|
|
|
total, repl = biddingSearch.GetAllByNgramWithCount()
|
|
|
if repl != nil && *repl != nil && len(*repl) > 0 {
|
|
|
//格式化查询结果
|
|
|
- list = SearchListFormat(so.Industry, *repl, strings.Contains(so.SelectType, "detail"), so.BidField)
|
|
|
+ list = SearchListFormat(so.Industry, so.Subinformation, *repl, strings.Contains(so.SelectType, "detail"), so.BidField)
|
|
|
count = util.If(so.IsPay, int64(bidsearch.SearchMaxPageCount_PAYED), int64(bidsearch.SearchMaxPageCount_PC)).(int64)
|
|
|
//数据如果>最大数据结果量 total==count,否则count = 付费:5000;免费:500;
|
|
|
count = util.If(count > total, total, count).(int64)
|
|
@@ -986,7 +987,7 @@ func (e *SearchByES) GetAllByNgramWithCount() (int64, *[]map[string]interface{})
|
|
|
}
|
|
|
|
|
|
// SearchListFormat 格式化数据
|
|
|
-func SearchListFormat(industry string, repl []map[string]interface{}, b bool, bidField string) (list []*map[string]interface{}) {
|
|
|
+func SearchListFormat(industry, subinformation string, repl []map[string]interface{}, b bool, bidField string) (list []*map[string]interface{}) {
|
|
|
for _, v := range repl {
|
|
|
//正文
|
|
|
if b {
|
|
@@ -1071,10 +1072,23 @@ func SearchListFormat(industry string, repl []map[string]interface{}, b bool, bi
|
|
|
//物业数据处理
|
|
|
subinformationArr := gconv.SliceStr(v["tag_subinformation"])
|
|
|
if len(subinformationArr) > 0 {
|
|
|
- for i, value := range subinformationArr {
|
|
|
- subinformationArr[i] = strings.Split(value, "_")[1]
|
|
|
+ if len(subinformation) > 0 {
|
|
|
+ fool := false
|
|
|
+ for _, s1 := range subinformationArr {
|
|
|
+ for _, s2 := range strings.Split(subinformation, ",") {
|
|
|
+ if s2 == strings.Split(s1, "_")[1] {
|
|
|
+ v["tag_subinformation"] = s2
|
|
|
+ fool = true
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if fool {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ v["tag_subinformation"] = strings.Split(subinformationArr[0], "_")[1]
|
|
|
}
|
|
|
- v["tag_subinformation"] = subinformationArr
|
|
|
}
|
|
|
//是否有附件
|
|
|
tag := gconv.Map(v["tag_set"])
|