wangshan 7 місяців тому
батько
коміт
fac9a3c0a2

+ 1 - 1
jyBXSubscribe/rpc/internal/logic/bypushhistorylogic.go

@@ -104,7 +104,7 @@ func (l *ByPushHistoryLogic) ByPushHistory(in *bxsubscribe.SubscribeInfosReq) (*
 	if len(spqp.SelectInfoIds) > 0 {
 		ids, keyWords = spqp.ExportPushFormat()
 	} else {
-		_, _, list, _ := model.NewSubscribePush(vipType).Datas(spqp, bsp)
+		_, _, list := model.NewSubscribePush(vipType).Datas(spqp, bsp)
 		if list == nil || len(list) == 0 {
 			return &bxsubscribe.ByPushHistoryResp{
 				ErrorCode: 1,

+ 10 - 14
jyBXSubscribe/rpc/internal/logic/getsublistlogic.go

@@ -8,7 +8,6 @@ import (
 	"bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/type/bxsubscribe"
 	"context"
 	"fmt"
-	"log"
 	"strconv"
 	"strings"
 	"time"
@@ -115,11 +114,13 @@ func (l *GetSubListLogic) GetSubList(in *bxsubscribe.SubscribeInfosReq) (*bxsubs
 	if in.UserType == model.EntnicheFlag {
 		spqp.UserId = common.InterfaceToStr(spqp.EntUserId)
 	}
-	var tip string
+	var (
+		tip string
+	)
 	sp := model.NewSubscribePush(in.UserType)
 	//用户信息
 	bsp := sp.GetUserInfo(spqp)
-	hasNextPage, total, list, tipBool := model.NewSubscribePush(in.UserType).Datas(spqp, bsp)
+	hasNextPage, total, list := model.NewSubscribePush(in.UserType).Datas(spqp, bsp)
 	start1 := time.Now().Unix()
 	logx.Info("1、查询数据用户", start1-start)
 	/*
@@ -140,18 +141,13 @@ func (l *GetSubListLogic) GetSubList(in *bxsubscribe.SubscribeInfosReq) (*bxsubs
 				hasNextPage, total, list = model.NewSubscribePush(in.UserType).GetRecListByEs()
 			}
 		}
+		//P618 增加预加载数据提示:为您预加载最近15天发布的【X】商机
+		//1、首次访问;2、无推送数据;3、数据量满足免费50条,付费用户1000条;4、非活跃用户不参与
 		if len(list) > 0 {
-			tipBool = true
-		}
-	}
-	log.Println("tip info:", spqp.PageNum, "--", tipBool, "--", total, "--", bsp.Size)
-	//P618 增加预加载数据提示:为您预加载最近15天发布的【X】商机
-	//1、首次访问;2、无推送数据;3、数据量满足免费50条,付费用户1000条
-	tipBool = spqp.PageNum == 1 && tipBool
-	if tipBool {
-		tip = fmt.Sprintf(IC.C.SubListTip, "")
-		if total >= int64(bsp.Size) {
-			tip = fmt.Sprintf(IC.C.SubListTip, fmt.Sprintf("%d条", bsp.Size))
+			tip = fmt.Sprintf(IC.C.SubListTip, "")
+			if total >= int64(bsp.Size) {
+				tip = fmt.Sprintf(IC.C.SubListTip, fmt.Sprintf("%d条", bsp.Size))
+			}
 		}
 	}
 	start2 := time.Now().Unix()

+ 2 - 5
jyBXSubscribe/rpc/model/push.go

@@ -327,7 +327,7 @@ func subStrDetail(matchKey, detail string) string {
 	}
 	return strings.TrimSpace(detail)
 }
-func (s *subscribePush) Datas(spqp *SubPushQueryParam, bsp *ViewCondition) (hasNextPage bool, total int64, result []*bxsubscribe.SubscribeInfo, tipBool bool) {
+func (s *subscribePush) Datas(spqp *SubPushQueryParam, bsp *ViewCondition) (hasNextPage bool, total int64, result []*bxsubscribe.SubscribeInfo) {
 	logx.Info(spqp.UserId, spqp.NewUserId, s.ModuleFlag, "subscribePush query param:", "SelectTime:", spqp.SelectTime, "Area:", spqp.Area, "District:", spqp.District, "City:", spqp.City, "Subtype:", spqp.Subtype, "Subscopeclass:", spqp.Subscopeclass, "Buyerclass:", spqp.Buyerclass, "Key:", spqp.Key, "PageNum:", spqp.PageNum, "Price:", spqp.Price, "FileExists:", spqp.FileExists, "SubPushInactive:", spqp.SubPushInactive)
 	if spqp.UserId == "" {
 		return
@@ -363,10 +363,7 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam, bsp *ViewCondition) (hasN
 			spqp.PageSize = 500
 		}
 		result, total = s.inactiveQuery(spqp, bsp)
-		hasNextPage = len(result) > spqp.PageSize
-		if total > 0 {
-			tipBool = true
-		}
+		hasNextPage = len(result) >= spqp.PageSize
 		return
 	}
 	nowFormat := date.NowFormat(date.Date_Short_Layout)