Browse Source

邮箱邀请

wangshan 9 năm trước cách đây
mục cha
commit
61cbddf549

+ 3 - 0
core/src/qfw/coreutil/share.go

@@ -2,6 +2,7 @@ package coreutil
 
 import (
 	"fmt"
+	"log"
 	"qfw/util/mongodb"
 	"time"
 )
@@ -14,12 +15,14 @@ func FindMyShareId(activecode, openid string) string {
 	var shareid string
 	if (*ret)["i_shareid"] == nil {
 		id := GetShareId(TYPE_INVITE)
+		log.Println("id:", id)
 		GetShareQR(id)
 		shareid = fmt.Sprintf("%d", id)
 		data := make(map[string]interface{})
 		data["s_openid"] = openid
 		data["s_businesscode"] = activecode
 		data["i_shareid"] = shareid
+		log.Println("shareid:", shareid)
 		data["l_timestamp"] = time.Now().Unix()
 		mongodb.Save("person_share", data)
 	} else {

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

@@ -150,7 +150,11 @@ func (n *Newscont) viewContent4Front(_id string, temp string) error {
 			time := (*r)["releasetime"]
 			if time != nil && time != "" {
 				time = time.(float64)
-				f := elastic.GetPage("content", "content", `{"releasetime": {"$gt": `+fmt.Sprint(time)+`}, "s_contenttype": "qykb"}`, `"releasetime"`, `{"_id":1,"s_title":1}`, 0, 1)
+				contenttype := "qykb"
+				if (*r)["s_contenttype"] == "zhsk" {
+					contenttype = "zhsk"
+				}
+				f := elastic.GetPage("content", "content", `{"releasetime": {"$gt": `+fmt.Sprint(time)+`}, "s_contenttype": "`+contenttype+`"}`, `"releasetime"`, `{"_id":1,"s_title":1}`, 0, 1)
 				if len(*f) > 0 {
 					for _, v := range *f {
 						if i == 0 {
@@ -161,7 +165,7 @@ func (n *Newscont) viewContent4Front(_id string, temp string) error {
 					}
 				}
 				var j = 0
-				nt := elastic.GetPage("content", "content", `{"releasetime": {"$lt": `+fmt.Sprint(time)+`}, "s_contenttype": "qykb"}`, `{"releasetime":-1}`, `{"_id":1,"s_title":1}`, 0, 1)
+				nt := elastic.GetPage("content", "content", `{"releasetime": {"$lt": `+fmt.Sprint(time)+`}, "s_contenttype": "`+contenttype+`"}`, `{"releasetime":-1}`, `{"_id":1,"s_title":1}`, 0, 1)
 				if len(*nt) > 0 {
 					for _, v := range *nt {
 						if j == 0 {

+ 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-01-22 14:49:19"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-22 14:49:19"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-22 17:02:43"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-22 17:02:43"}},"marketisstart":true,"marketrate":300}