From e05d6866ee799dd74e280a6391eecd5817f15fd1 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 12 Feb 2026 16:27:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=8B=E6=9C=88=E6=B4=BB=E5=8A=A8=E5=89=8D?= =?UTF-8?q?=E4=B8=89=E5=90=8D=E9=A1=BA=E5=BA=8F=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../other/infra/gateway/RankingActivityGatewayImpl.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/RankingActivityGatewayImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/RankingActivityGatewayImpl.java index 466fcbfa..9b322ee7 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/RankingActivityGatewayImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/RankingActivityGatewayImpl.java @@ -187,10 +187,13 @@ public class RankingActivityGatewayImpl implements RankingActivityGateway { .first("userId").as("userId") .first("userSex").as("userSex") .first("activityType").as("activityType") - .first("dimension").as("dimension"), - // 3. 按总数量降序排序 + .first("dimension").as("dimension") + .first("createTime").as("createTime"), + // 3. 按总数量降序排序,createTime升序排序 Aggregation.sort( - org.springframework.data.domain.Sort.Direction.DESC, "quantity" + org.springframework.data.domain.Sort.Direction.DESC, "quantity" + ).and( + org.springframework.data.domain.Sort.Direction.ASC, "createTime" ), // 4. 限制返回数量 Aggregation.limit(topN)