李广朋 9 лет назад
Родитель
Сommit
b847d58dd3
1 измененных файлов с 3 добавлено и 48 удалено
  1. 3 48
      core/src/qfw/search/wxsearchservice.go

+ 3 - 48
core/src/qfw/search/wxsearchservice.go

@@ -10,11 +10,8 @@ import (
 	"qfw/coreutil"
 	"qfw/mobile"
 	. "qfw/util"
-	"qfw/util/consts"
 	"qfw/util/elastic"
-	ip "qfw/util/ip17mon"
 	. "qfw/util/mongodb"
-	"qfw/util/redis"
 	"strconv"
 	"strings"
 	"time"
@@ -60,6 +57,9 @@ func (n *Wxsearch) WxgetEnterpriseList(reqType, param /*参数*/ string) error {
 		log.Println(rs)
 		querymap["entcard"] = n.GetString("mingpian")
 		if n.GetString("currentPage") != "" {
+			n.SetHeader("Pragma", "No-cache")
+			n.SetHeader("Cache-Control", "no-cache")
+			n.SetHeader("Expires", "0")
 			return n.Write(rs)
 		}
 		n.Render("/member/incmobile/list.html", &xweb.T{"data": rs, "querymap": querymap})
@@ -126,49 +126,8 @@ func wxsearhWebContentent(querymap map[string]string, n *Wxsearch, reqType strin
 	city := querymap["city"]
 	var tempQuery = ""
 	var query = ""
-	cityNo := querymap["cityNo"]
 	tempBisOne := false
-	ipcity := ""
-	if cityNo == "" && len(queryStr) == 0 {
-		querymap["cityNo"] = "1"
-		tn, er := ip.Find(n.Protocol())
-		if nil == er {
-			switch tn.Region {
-			case "河南", "广西", "黑龙江", "青海", "西藏", "安徽", "山西":
-				ipcity = consts.Scode[tn.Region]
-				if len(ipcity) > 0 {
-					tmp_res := redis.Get("enterprise", "wx_ipcity_"+ipcity+"_1")
-					if nil != tmp_res {
-						tmp_res1, oks1 := tmp_res.([]interface{})
 
-						if tmp_res1 != nil && oks1 {
-							tmp_resn := make([]map[string]interface{}, len(tmp_res1))
-							for k := 0; k < len(tmp_res1); k++ {
-								tmp_resn1, _ := tmp_res1[k].(map[string]interface{})
-								tmp_resn[k] = tmp_resn1
-							}
-							return &tmp_resn
-						}
-					}
-
-					//str += `{"prefix":{"OpLocDistrict":"` + ipcity + `"}}`
-					tempBisOne = true
-					query = `{"query": {
-					"function_score": {
-						      "script_score": {
-						        "script": "if(doc['OpLocDistrict'].value&&doc['OpLocDistrict'].value.substring(0,2)=='` + ipcity + `') return 1 else return 0"
-						      }
-						    }
-						  }
-						,"_source":["_id","EntName","RegOrgName","RegNo","EntType","LeRep","EstDate","OpLocDistrictName","RegCap","OpStateName","OpState","s_servicenames","s_action","OpLocDistrict","RegCapCurName","s_avatar"]
-						,"from":0,
-						"size":` + fmt.Sprintf("%v", perPage) + `,
-						  "sort": [{"_score": "desc"},{"OpSint":"desc"},{"RegCap":"desc"}]
-						}`
-				}
-			}
-		}
-	}
 	if !tempBisOne {
 		if city != "" && city != "0" {
 			//fmt.Println("city:", city)
@@ -399,10 +358,6 @@ func wxsearhWebContentent(querymap map[string]string, n *Wxsearch, reqType strin
 
 		}
 	}
-
-	if tempBisOne && len(ipcity) > 0 {
-		redis.Put("enterprise", "wx_ipcity_"+ipcity+"_1", res, 5*86400)
-	}
 	return &res
 }