Pārlūkot izejas kodu

新闻资讯内容页

wangshan 9 gadi atpakaļ
vecāks
revīzija
d7f601c4c8
2 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. 2 2
      core/src/qfw/front/webcentent.go
  2. 1 1
      core/src/timetask.json

+ 2 - 2
core/src/qfw/front/webcentent.go

@@ -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))

+ 1 - 1
core/src/timetask.json

@@ -1 +1 @@
-{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-03-23 15:15:05"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-03-23 15:15:05"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-03-24 11:22:15"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-03-24 11:22:15"}},"marketisstart":true,"marketrate":300}