فهرست منبع

物业搜索修改

WH01243 1 سال پیش
والد
کامیت
29b5a23415
3فایلهای تغییر یافته به همراه23 افزوده شده و 9 حذف شده
  1. 20 6
      src/jfw/front/searchOptimize.go
  2. 3 0
      src/jfw/front/supsearch.go
  3. 0 3
      src/jfw/front/swordfish.go

+ 20 - 6
src/jfw/front/searchOptimize.go

@@ -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"])

+ 3 - 0
src/jfw/front/supsearch.go

@@ -415,6 +415,9 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 	default:
 		territorialization = ""
 	}
+	if territorialization == "" {
+		territorialization = p.GetString("property")
+	}
 	userInfo := jy.GetVipState(p.Session(), *config.Middleground, userId)
 	queryItems := userInfo.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
 	isPayedUser := userInfo.IsPayedUser()

+ 0 - 3
src/jfw/front/swordfish.go

@@ -135,7 +135,6 @@ func (m *Front) PcAjaxReq() {
 	isfile, _ := m.GetInteger("isfile")
 	//换手率 changehand
 	changehand, _ := m.GetInteger("changehand")
-	log.Println("1111", userId, searchGroup, subtype)
 	if userId == "" {
 		//未登录用户访问全部信息类型 需要过滤掉 拟建和采购意向
 		// p397 未登录用户收回查看拟建权限
@@ -153,7 +152,6 @@ func (m *Front) PcAjaxReq() {
 				subtype = "招标预告,招标公告,招标结果,招标信用信息"
 			}
 		}
-		log.Println("2222", userId, searchGroup, subtype)
 		//未登录用户搜索范围 标题和 正文
 		var selectTypeArr []string
 		selectTypeSplit := strings.Split(selectType, ",")
@@ -170,7 +168,6 @@ func (m *Front) PcAjaxReq() {
 			publishtime = ""
 		}
 	}
-	log.Println("2222", userId, searchGroup, subtype)
 	industry := strings.TrimSpace(m.GetString("industry"))
 	minprice := m.GetString("minprice")               //最低价格
 	maxprice := m.GetString("maxprice")               //最高价格