|
@@ -5,7 +5,6 @@ import (
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
"html/template"
|
|
|
- "jy/src/jfw/config"
|
|
|
"regexp"
|
|
|
"strconv"
|
|
|
"time"
|
|
@@ -24,7 +23,7 @@ const (
|
|
|
)
|
|
|
|
|
|
//GetFirstJyCms 获取首评信息
|
|
|
-func GetFirstJyCms(contentType string, size int) (r []map[string]interface{}) {
|
|
|
+func GetFirstJyCms(contentType string, size int, Seoconfig map[string]interface{}) (r []map[string]interface{}) {
|
|
|
// 默认剑鱼博客栏目
|
|
|
contentType = util.If(contentType == "", "jybk", contentType).(string)
|
|
|
redisKey := fmt.Sprintf(jyMsgFirstCache, contentType, size)
|
|
@@ -34,7 +33,7 @@ func GetFirstJyCms(contentType string, size int) (r []map[string]interface{}) {
|
|
|
rs, _ := JyCmsSearch(map[string]string{
|
|
|
"contentType": contentType,
|
|
|
"perPage": fmt.Sprintf("%d", size),
|
|
|
- })
|
|
|
+ }, Seoconfig)
|
|
|
if rs != nil {
|
|
|
for _, v := range *rs {
|
|
|
delete(v, "praise")
|
|
@@ -49,7 +48,7 @@ func GetFirstJyCms(contentType string, size int) (r []map[string]interface{}) {
|
|
|
}
|
|
|
|
|
|
// JyCmsSearch 剑鱼文章检索
|
|
|
-func JyCmsSearch(query map[string]string) (*[]map[string]interface{}, *[]interface{}) {
|
|
|
+func JyCmsSearch(query map[string]string, Seoconfig map[string]interface{}) (*[]map[string]interface{}, *[]interface{}) {
|
|
|
perPage, _ := strconv.Atoi(query["perPage"])
|
|
|
currentPage, _ := strconv.Atoi(query["currentPage"])
|
|
|
//修复
|
|
@@ -111,12 +110,12 @@ func JyCmsSearch(query map[string]string) (*[]map[string]interface{}, *[]interfa
|
|
|
m["time"] = reltime.Format(Date_Short_Layout) //首页展示
|
|
|
s_pic, _ := m["s_pic"].(string)
|
|
|
if s_pic != "" {
|
|
|
- s_pic = config.Seoconfig["jyadd"].(string) + s_pic
|
|
|
+ s_pic = Seoconfig["jyadd"].(string) + s_pic
|
|
|
}
|
|
|
m["s_pic"] = s_pic
|
|
|
s_pic1, _ := m["s_pic1"].(string)
|
|
|
if s_pic1 != "" {
|
|
|
- s_pic1 = config.Seoconfig["jyadd"].(string) + s_pic1
|
|
|
+ s_pic1 = Seoconfig["jyadd"].(string) + s_pic1
|
|
|
}
|
|
|
m["s_pic1"] = s_pic1
|
|
|
m["_id"] = se.EncodeString(BsonIdToSId(m["_id"]))
|