wangchuanjin 4 年之前
父節點
當前提交
3d9c9f27c8
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      src/jfw/modules/common/src/qfw/util/jy/subscribepush.go

+ 4 - 3
src/jfw/modules/common/src/qfw/util/jy/subscribepush.go

@@ -180,6 +180,7 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, result
 		spqp.PageNum = 1
 	}
 	starttime, endtime := int64(0), int64(0)
+	st, et := "", ""
 	now := time.Now()
 	if spqp.SelectTime == "lately-7" { //最近7天
 		starttime = time.Date(now.Year(), now.Month(), now.Day()-7, 0, 0, 0, 0, time.Local).Unix()
@@ -189,9 +190,9 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, result
 		starttime = time.Date(now.Year()-1, 1, 1, 0, 0, 0, 0, time.Local).Unix()
 		endtime = time.Date(now.Year()-1, 12, 31, 23, 59, 59, 0, time.Local).Unix()
 	} else if len(strings.Split(spqp.SelectTime, "_")) == 2 {
-		st := strings.Split(spqp.SelectTime, "_")[0]
+		st = strings.Split(spqp.SelectTime, "_")[0]
 		starttime, _ = strconv.ParseInt(st, 0, 64)
-		et := strings.Split(spqp.SelectTime, "_")[1]
+		et = strings.Split(spqp.SelectTime, "_")[1]
 		endtime, _ = strconv.ParseInt(et, 0, 64)
 		if endtime > 0 {
 			etTime := time.Unix(endtime, 0)
@@ -202,7 +203,7 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, result
 	start := (spqp.PageNum - 1) * pageSize
 	end := start + pageSize
 	//时间是今天,没有别的过滤条件
-	if starttime > 0 && starttime == endtime && nowFormat == FormatDateByInt64(&starttime, Date_Short_Layout) && spqp.Area == "" && spqp.Buyerclass == "" && spqp.Subscopeclass == "" && spqp.Subtype == "" && spqp.Key == "" {
+	if starttime > 0 && st == et && nowFormat == FormatDateByInt64(&starttime, Date_Short_Layout) && spqp.Area == "" && spqp.Buyerclass == "" && spqp.Subscopeclass == "" && spqp.Subtype == "" && spqp.Key == "" {
 		subPush, err := s.GetTodayCache(spqp.UserId)
 		if err != nil {
 			log.Println(spqp.UserId, "GetTodayCache Error", err)