|
@@ -322,13 +322,15 @@ func GetNextInfo(_id string, keyWord ...string) (lastId, nextId string) {
|
|
|
if doc == nil || len(*doc) == 0 {
|
|
|
return
|
|
|
}
|
|
|
+ //增加浏览次数
|
|
|
+ go Browsing(_id, util.IntAll((*doc)["i_viewnum"]))
|
|
|
commonQuery := map[string]interface{}{
|
|
|
"i_status": 1,
|
|
|
"releasetime": map[string]interface{}{
|
|
|
"$lt": time.Now().Unix(),
|
|
|
},
|
|
|
}
|
|
|
- for _, t := range []string{"s_contenttype", "s_secondclassifytype", "s_threeclassifytype"} {
|
|
|
+ for _, t := range []string{"s_contenttype"} {
|
|
|
if tv, _ := (*doc)[t].(string); tv != "" {
|
|
|
commonQuery[t] = tv
|
|
|
}
|
|
@@ -338,6 +340,7 @@ func GetNextInfo(_id string, keyWord ...string) (lastId, nextId string) {
|
|
|
"$regex": keyWord[0],
|
|
|
}
|
|
|
}
|
|
|
+ log.Println("content上下文query:", commonQuery)
|
|
|
dataOn, ok := mongodb.Find("content", commonQuery, `{"releasetime":-1,"l_createdate":-1}`, `{"_id":1,"i_viewnum":1,releasetime":-1,"l_createdate":1}`, false, -1, -1)
|
|
|
if ok && dataOn != nil && len(*dataOn) > 0 {
|
|
|
for k, v := range *dataOn {
|
|
@@ -490,3 +493,10 @@ func PidColumn(id string) []Navigation {
|
|
|
return allColumn
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+func Browsing(id string, viewNum int) {
|
|
|
+ mongodb.UpdateById("content", id, map[string]interface{}{
|
|
|
+ "$set": map[string]interface{}{
|
|
|
+ "i_viewnum": viewNum + 1,
|
|
|
+ }})
|
|
|
+}
|