|
@@ -13,7 +13,6 @@ import (
|
|
|
"jyBXCore/rpc/internal/config"
|
|
|
"jyBXCore/rpc/model/es"
|
|
|
"jyBXCore/rpc/type/bxcore"
|
|
|
- "log"
|
|
|
"math/big"
|
|
|
"net/http"
|
|
|
"net/url"
|
|
@@ -684,16 +683,17 @@ func IsOptimize(cc config.Config, in *bxcore.SearchReq) bool {
|
|
|
}
|
|
|
|
|
|
//
|
|
|
-func GetPublishTime(tt int, publishTime string) string {
|
|
|
+func GetPublishTime(ym, publishTime string) string {
|
|
|
//发布时间
|
|
|
if publishTime != "" && len(strings.Split(publishTime, "-")) > 1 {
|
|
|
- now := time.Now()
|
|
|
startTime, _ := strconv.ParseInt(strings.Split(publishTime, "-")[0], 10, 64)
|
|
|
endTime, _ := strconv.ParseInt(strings.Split(publishTime, "-")[1], 10, 64)
|
|
|
- pTime := time.Date(now.Year()-tt, now.Month(), now.Day(), 0, 0, 0, 0, time.Local).Unix()
|
|
|
- log.Println(pTime, "---", endTime)
|
|
|
+ reduceYear, _ := strconv.Atoi(strings.Split(ym, "-")[0])
|
|
|
+ reduceMonth, _ := strconv.Atoi(strings.Split(ym, "-")[1])
|
|
|
+ //因月份规范化 收到的影响 不考虑
|
|
|
+ pTime := time.Unix(endTime, 0).AddDate(-reduceYear, -reduceMonth, 0).Unix()
|
|
|
//超过一年
|
|
|
- if endTime > startTime && pTime > startTime {
|
|
|
+ if endTime-startTime > pTime {
|
|
|
return fmt.Sprint(pTime) + "-" + fmt.Sprint(endTime)
|
|
|
}
|
|
|
}
|