From 61cc9037a887812963ea0f99b020e296a6268184 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Sun, 27 Apr 2025 13:41:11 +0800
Subject: [PATCH] feat(mall): 增加活动热度排序功能并更新相关配置

---
 src/main/resources/mapper/modules/HappyActivityOptionMapper.xml |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/modules/HappyActivityOptionMapper.xml b/src/main/resources/mapper/modules/HappyActivityOptionMapper.xml
index 699c95e..a4f9cf7 100644
--- a/src/main/resources/mapper/modules/HappyActivityOptionMapper.xml
+++ b/src/main/resources/mapper/modules/HappyActivityOptionMapper.xml
@@ -30,7 +30,13 @@
                 </if>
             </if>
         </where>
-        order by a.order_cnt asc, a.id desc
+        <if test="record.hotState != null">
+            order by (select count(id) from happy_follow where source_id = a.id and type in (2,3)) desc,a.order_cnt asc
+        </if>
+        <if test="record.hotState == null">
+            order by a.order_cnt asc,a.id desc
+        </if>
+
     </select>
 
     <select id="getVoteRecordInPage" resultType="cc.mrbird.febs.mall.vo.ApiVoteRecordInPageVo">

--
Gitblit v1.9.1