|
@@ -200,6 +200,7 @@ func (n *Newscont) viewContent4Front(_id string, temp string) error {
|
|
|
if ret := redis.Get("other", n.Url()); ret != nil {
|
|
|
return n.SetBody([]byte(ret.(string)))
|
|
|
} else {
|
|
|
+ contenttype := "qykb"
|
|
|
r := elastic.GetByIdField("content", "content", _id, `"_id","s_title","l_createdate","s_pic","s_author","s_editorname","s_contenttype","praise","releasetime","s_subcontent","s_url","s_content","s_source","s_keywords","s_description","s_contenttype"`)
|
|
|
//r := mongodb.FindById("content", _id, `{"_id":1,"s_title":1,"l_createdate":1,"s_editorname":1,"s_contenttype":1,"s_content":1,"s_source":1}`)
|
|
|
if nil != r {
|
|
@@ -207,7 +208,6 @@ func (n *Newscont) viewContent4Front(_id string, temp string) error {
|
|
|
time := (*r)["releasetime"]
|
|
|
if time != nil && time != "" {
|
|
|
time = time.(float64)
|
|
|
- contenttype := "qykb"
|
|
|
if (*r)["s_contenttype"] == "zhsk" {
|
|
|
contenttype = "zhsk"
|
|
|
}
|
|
@@ -241,7 +241,7 @@ func (n *Newscont) viewContent4Front(_id string, temp string) error {
|
|
|
if len(author) < 1 {
|
|
|
(*r)["s_author"] = ""
|
|
|
}
|
|
|
- hotnews := elastic.GetPage("content", "content", `{"s_contenttype": "qykb"}`, `{"praise":-1}`, `{"_id":1,"s_title":1,"praise":1}`, 0, 10)
|
|
|
+ hotnews := elastic.GetPage("content", "content", `{"s_contenttype": "`+contenttype+`"}`, `{"praise":-1}`, `{"_id":1,"s_title":1,"praise":1}`, 0, 10)
|
|
|
(*r)["hotnews"] = hotnews
|
|
|
n.T = *r
|
|
|
(*r)["s_content"] = template.HTML((*r)["s_content"].(string))
|