wangchuanjin 8 mesiacov pred
rodič
commit
5a689e8568
2 zmenil súbory, kde vykonal 6 pridanie a 6 odobranie
  1. 1 0
      p/struct.go
  2. 5 6
      recommend/recommend.go

+ 1 - 0
p/struct.go

@@ -930,6 +930,7 @@ type MatchInfo struct {
 	MatchWays []string
 	DisId     string
 	HandDis   bool //是否分发
+	Extend    map[string]interface{}
 }
 
 type KeyDfa struct {

+ 5 - 6
recommend/recommend.go

@@ -48,14 +48,13 @@ func (r *Recommend) SubRecommend(tidb *Mysql, domain, userId, content string, ma
 	jcly := ""
 	for k, v := range *list {
 		if k == 0 {
-			key := ObjToString(v["key"])
-			projectname := ObjToString(v["projectname"])
+			matchkeys := ObjToString(v["matchkeys"])
 			if typ := Int64All(v["type"]); typ == 1 {
-				jcly = fmt.Sprintf(searchTmpl, ShortenTxt(20, fmt.Sprintf(searchTmpl, ""), key))
+				jcly = fmt.Sprintf(searchTmpl, ShortenTxt(20, fmt.Sprintf(searchTmpl, ""), matchkeys))
 			} else if typ == 2 {
-				jcly = fmt.Sprintf(visitTmpl, ShortenTxt(20, fmt.Sprintf(visitTmpl, ""), projectname))
+				jcly = fmt.Sprintf(visitTmpl, ShortenTxt(20, fmt.Sprintf(visitTmpl, ""), matchkeys))
 			} else if typ == 3 {
-				jcly = fmt.Sprintf(subsetTmpl, ShortenTxt(20, fmt.Sprintf(subsetTmpl, ""), key))
+				jcly = fmt.Sprintf(subsetTmpl, ShortenTxt(20, fmt.Sprintf(subsetTmpl, ""), matchkeys))
 			}
 		}
 		infosLength++
@@ -89,7 +88,7 @@ func (r *Recommend) SubRecommend(tidb *Mysql, domain, userId, content string, ma
 
 //
 func (r *Recommend) getList(tidb *Mysql, userId string, limit int) (*[]map[string]interface{}, string) {
-	datas := tidb.SelectBySql(`select type,autoid,area,projectname,key from push.sub_recommend_list where userid=? order by create_time desc limit ?`, userId, limit)
+	datas := tidb.SelectBySql(`select type,autoid,area,matchkeys from push.sub_recommend_list where userid=? order by create_time desc limit ?`, userId, limit)
 	if datas == nil || len(*datas) == 0 {
 		return nil, ""
 	}