From 06db759749df76375300e566389c456745b18e78 Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 30 Sep 2024 11:28:53 +0800 Subject: [PATCH] =?UTF-8?q?my=20work=20bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ai/da/service/impl/PortfolioServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java b/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java index 62cc019d..f3128c6e 100644 --- a/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java @@ -448,7 +448,7 @@ public class PortfolioServiceImpl extends ServiceImpl excludeIds = new ArrayList<>(); // 存放需要排除的 ID 列表 // 获取前三点赞和前三浏览的作品集,并将其排除在分页查询之外 - if (query.getPage() == 1 && (query.getGetMyPortfolio() != 1 || query.getGetLikePortfolio() != 1)) { + if (query.getPage() == 1 && (query.getGetMyPortfolio() != 1 && query.getGetLikePortfolio() != 1)) { // 获取前三点赞的作品集 ID List topThreeLike = getTopThreeLikeFromRedis(RedisUtil.PORTFOLIO_LIKE_KEY); List topThreeView = getTopThreeViewFromRedis(RedisUtil.PORTFOLIO_VIEW_KEY, topThreeLike); @@ -484,7 +484,7 @@ public class PortfolioServiceImpl extends ServiceImpl page = portfolioMapper.selectPage(new Page<>(query.getPage(), query.getSize()), qw); // 如果前三点赞和浏览不为空,将它们添加到分页查询的结果最前面 - if (!topThree.isEmpty()) { + if (!topThree.isEmpty() && (query.getGetMyPortfolio() != 1 && query.getGetLikePortfolio() != 1)) { List records = page.getRecords(); records.addAll(0, topThree); // 添加到查询结果的开头 page.setRecords(records);