Răsfoiți Sursa

fix:seo查询需改

duxin 1 an în urmă
părinte
comite
3ae2e05df7
1 a modificat fișierele cu 7 adăugiri și 5 ștergeri
  1. 7 5
      src/jfw/front/frontRouter.go

+ 7 - 5
src/jfw/front/frontRouter.go

@@ -222,7 +222,7 @@ func (this *CommonRouter) doPcBigPage(pageSign, types string) error {
 	}
 	if userid == "" {
 		if strings.Contains(pageSign, "ent_ser_portrait") || strings.Contains(pageSign, "ent_portrait") {
-			urlArr := strings.Split(pageSign, "/")
+			urlArr := strings.Split(pageSign, "_portrait/")
 			entId := encrypt.DecodeArticleId2ByCheck(urlArr[len(urlArr)-1])[0]
 			if seoId := esSeoId(true, entId); seoId != "" {
 				return this.Redirect(fmt.Sprintf("/qy/%s.html", seoId))
@@ -245,9 +245,9 @@ func esSeoId(isWinner bool, idName string) string {
 	var seoId string
 	redisKey := fmt.Sprintf("getSeoId_%v_%s", isWinner, idName)
 	//seoId = redis.GetStr("newother", redisKey)
-	if seoId != "" {
-		return seoId
-	}
+	//if seoId != "" {
+	//	return seoId
+	//}
 
 	if isWinner {
 		//q := "SELECT  company_id AS id,name,name_id,seo_id  FROM   dws_f_ent_baseinfo WHERE    name_id =? and company_id !='' and company_id is not null  AND (identity_type &(1 << ?)) > 0 order by latest_time desc  limit ?"
@@ -265,7 +265,9 @@ func esSeoId(isWinner bool, idName string) string {
 			seoId = common.InterfaceToStr((*data)["seo_id"])
 		}
 	}
-	redis.Put("newother", redisKey, seoId, -1)
+	if seoId != "" {
+		redis.Put("newother", redisKey, seoId, -1)
+	}
 	return seoId
 }