|
@@ -163,6 +163,26 @@ func (p *Purchase) PurchaseListFormat(res []map[string]interface{}) (list []*bxc
|
|
area := MC.InterfaceToStr(rv["area"])
|
|
area := MC.InterfaceToStr(rv["area"])
|
|
city := MC.InterfaceToStr(rv["city"])
|
|
city := MC.InterfaceToStr(rv["city"])
|
|
district := MC.InterfaceToStr(rv["district"])
|
|
district := MC.InterfaceToStr(rv["district"])
|
|
|
|
+ title := MC.InterfaceToStr(rv["title"])
|
|
|
|
+ if len([]rune(title)) > 50 {
|
|
|
|
+ splitStr := "-"
|
|
|
|
+ titles := strings.Split(title, splitStr)
|
|
|
|
+ lastPart := ""
|
|
|
|
+ if len(titles) > 1 {
|
|
|
|
+ lastPart = titles[len(titles)-1]
|
|
|
|
+ if lastPart == city || lastPart == area || lastPart == district {
|
|
|
|
+ title = strings.Join(titles[:len(titles)-1], splitStr)
|
|
|
|
+ } else {
|
|
|
|
+ lastPart = ""
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if len([]rune(title)) > 50 {
|
|
|
|
+ title = string([]rune(title)[:50])
|
|
|
|
+ }
|
|
|
|
+ if lastPart != "" {
|
|
|
|
+ title = fmt.Sprintf("%s%s%s", title, splitStr, lastPart)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
regionUrl := ""
|
|
regionUrl := ""
|
|
if district != "" && IC.DistrictMap[district] != "" {
|
|
if district != "" && IC.DistrictMap[district] != "" {
|
|
regionUrl = fmt.Sprintf(AreaLabelLink, "city", IC.DistrictMap[district])
|
|
regionUrl = fmt.Sprintf(AreaLabelLink, "city", IC.DistrictMap[district])
|
|
@@ -227,7 +247,7 @@ func (p *Purchase) PurchaseListFormat(res []map[string]interface{}) (list []*bxc
|
|
BuyerClass: MC.InterfaceToStr(rv["buyerclass"]),
|
|
BuyerClass: MC.InterfaceToStr(rv["buyerclass"]),
|
|
PublishTime: MC.Int64All(rv["publishtime"]),
|
|
PublishTime: MC.Int64All(rv["publishtime"]),
|
|
FileExists: isValidFile,
|
|
FileExists: isValidFile,
|
|
- Title: MC.InterfaceToStr(rv["title"]),
|
|
|
|
|
|
+ Title: title,
|
|
Price: price,
|
|
Price: price,
|
|
Buyer: buyer,
|
|
Buyer: buyer,
|
|
BuyerTel: buyerTel,
|
|
BuyerTel: buyerTel,
|
|
@@ -449,7 +469,6 @@ func (p *Purchase) FindDataFromES() (int64, []map[string]interface{}, error) {
|
|
HighLight: false, //是否高亮正文
|
|
HighLight: false, //是否高亮正文
|
|
}
|
|
}
|
|
total, list = biddingSearch.GetAllByNgramWithCount(es.LoginTypePay)
|
|
total, list = biddingSearch.GetAllByNgramWithCount(es.LoginTypePay)
|
|
- log.Println(total, "---------222----------", list)
|
|
|
|
if total == 0 || list == nil {
|
|
if total == 0 || list == nil {
|
|
log.Println(fmt.Errorf("暂无数据"))
|
|
log.Println(fmt.Errorf("暂无数据"))
|
|
return 0, nil, nil
|
|
return 0, nil, nil
|