|
@@ -48,14 +48,13 @@ func (r *Recommend) SubRecommend(tidb *Mysql, domain, userId, content string, ma
|
|
jcly := ""
|
|
jcly := ""
|
|
for k, v := range *list {
|
|
for k, v := range *list {
|
|
if k == 0 {
|
|
if k == 0 {
|
|
- key := ObjToString(v["key"])
|
|
|
|
- projectname := ObjToString(v["projectname"])
|
|
|
|
|
|
+ matchkeys := ObjToString(v["matchkeys"])
|
|
if typ := Int64All(v["type"]); typ == 1 {
|
|
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 {
|
|
} 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 {
|
|
} 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++
|
|
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) {
|
|
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 {
|
|
if datas == nil || len(*datas) == 0 {
|
|
return nil, ""
|
|
return nil, ""
|
|
}
|
|
}
|