|
@@ -208,7 +208,7 @@ func (s *subscribePush) InfoFormat(p *PushCa, info *map[string]interface{}) *Sub
|
|
|
}
|
|
|
|
|
|
func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total int64, result []*SubPushList) {
|
|
|
- // log.Println(spqp.UserId, s.ModuleFlag, "subscribePush query param:", "SelectTime", spqp.SelectTime, "Area", spqp.Area, "City", spqp.City, "Subtype", spqp.Subtype, "Subscopeclass", spqp.Subscopeclass, "Buyerclass", spqp.Buyerclass, "Key", spqp.Key, "PageNum", spqp.PageNum)
|
|
|
+ log.Println(spqp.UserId, s.ModuleFlag, "subscribePush query param:", "SelectTime", spqp.SelectTime, "Area", spqp.Area, "City", spqp.City, "Subtype", spqp.Subtype, "Subscopeclass", spqp.Subscopeclass, "Buyerclass", spqp.Buyerclass, "Key", spqp.Key, "PageNum", spqp.PageNum)
|
|
|
if spqp.UserId == "" {
|
|
|
return
|
|
|
}
|
|
@@ -227,6 +227,7 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total
|
|
|
starttime, endtime := int64(0), int64(0)
|
|
|
st, et := "", ""
|
|
|
now := time.Now()
|
|
|
+ log.Println(4444)
|
|
|
if spqp.SelectTime == "today" { //今天
|
|
|
starttime = time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local).Unix()
|
|
|
} else if spqp.SelectTime == "yesterday" { //昨天
|
|
@@ -249,11 +250,14 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total
|
|
|
endtime = time.Date(etTime.Year(), etTime.Month(), etTime.Day(), 23, 59, 59, 0, time.Local).Unix()
|
|
|
}
|
|
|
}
|
|
|
+ log.Println(2222)
|
|
|
nowFormat := NowFormat(Date_Short_Layout)
|
|
|
start := (spqp.PageNum - 1) * spqp.PageSize
|
|
|
end := start + spqp.PageSize
|
|
|
//时间是今天,没有别的过滤条件
|
|
|
if nowFormat == FormatDateByInt64(&starttime, Date_Short_Layout) && spqp.Area == "" && spqp.City == "" && spqp.Buyerclass == "" && spqp.Subscopeclass == "" && spqp.Subtype == "" && spqp.Key == "" {
|
|
|
+
|
|
|
+ log.Println("a1")
|
|
|
subPush, err := s.GetTodayCache(spqp.UserId)
|
|
|
if err != nil {
|
|
|
log.Println(spqp.UserId, "GetTodayCache Error", err)
|
|
@@ -276,12 +280,15 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total
|
|
|
}
|
|
|
total = int64(length)
|
|
|
} else if spqp.IsEmpty() && (spqp.PageNum-1)*spqp.PageSize <= 250 { //全部,没有过滤条件 之前缓存5页*50条=250
|
|
|
- allCache, err := s.GetAllCache(spqp.UserId)
|
|
|
+ log.Println("a2")
|
|
|
+ allCache, err := s.GetAllCache(spqp.UserId)
|
|
|
if err != nil {
|
|
|
log.Println(spqp.UserId, "GetAllCache Error", err)
|
|
|
}
|
|
|
if err != nil || allCache == nil || allCache.Date != nowFormat || len(allCache.Datas) == 0 {
|
|
|
+ log.Println("a3")
|
|
|
spqp.PageNum = 1
|
|
|
+ log.Println(1111)
|
|
|
list, countSearch := s.getDatasFromMysql(spqp, starttime, endtime, AllSubPushCacheSize, true)
|
|
|
allCache = &SubPush{
|
|
|
Date: nowFormat,
|
|
@@ -299,6 +306,7 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total
|
|
|
}
|
|
|
total = allCache.Count
|
|
|
} else {
|
|
|
+ log.Println("a4")
|
|
|
result, total = s.getDatasFromMysql(spqp, starttime, endtime, spqp.PageSize, true)
|
|
|
}
|
|
|
if result == nil {
|