Merge remote-tracking branch 'origin/dev/dev' into dev/dev
This commit is contained in:
@@ -448,7 +448,7 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
||||
List<Long> 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<Long> topThreeLike = getTopThreeLikeFromRedis(RedisUtil.PORTFOLIO_LIKE_KEY);
|
||||
List<Long> topThreeView = getTopThreeViewFromRedis(RedisUtil.PORTFOLIO_VIEW_KEY, topThreeLike);
|
||||
@@ -484,7 +484,7 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
||||
IPage<Portfolio> page = portfolioMapper.selectPage(new Page<>(query.getPage(), query.getSize()), qw);
|
||||
|
||||
// 如果前三点赞和浏览不为空,将它们添加到分页查询的结果最前面
|
||||
if (!topThree.isEmpty()) {
|
||||
if (!topThree.isEmpty() && (query.getGetMyPortfolio() != 1 && query.getGetLikePortfolio() != 1)) {
|
||||
List<Portfolio> records = page.getRecords();
|
||||
records.addAll(0, topThree); // 添加到查询结果的开头
|
||||
page.setRecords(records);
|
||||
|
||||
Reference in New Issue
Block a user