feat(AI资源广场): 优化AI资源排序

This commit is contained in:
otto 2026-05-28 10:07:47 +08:00
parent 6f881dad5c
commit a5e2efe2df
1 changed files with 24 additions and 6 deletions

View File

@ -162,7 +162,20 @@
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
ORDER BY zr.sort DESC
<choose>
<when test="resourceCategory != null and resourceCategory !=''">
ORDER BY
zr.like_count DESC,
(select sum(download_count) from sys_file_info sf where FIND_IN_SET(sf.file_id,zr.file_ids)) desc,
zr.view_count DESC,
zr.update_time DESC,
zr.create_time DESC
</when>
<otherwise>
ORDER BY zr.sort DESC
</otherwise>
</choose>
</where>
</sql>
@ -190,12 +203,17 @@
<!-- 数据范围过滤 -->
${params.dataScope}
<choose>
<when test="orderByDownloadCount != null and orderByDownloadCount">
order by (select sum(download_count) from sys_file_info sf where FIND_IN_SET(sf.file_id,zr.file_ids)) desc
</when>
<when test="orderByDownloadCount = null and orderByColumn = null and orderByColumn =''">
order by zr.sort DESC
<when test="resourceCategory != null and resourceCategory !=''">
ORDER BY
zr.like_count DESC,
(select sum(download_count) from sys_file_info sf where FIND_IN_SET(sf.file_id,zr.file_ids)) desc,
zr.view_count DESC,
zr.update_time DESC,
zr.create_time DESC
</when>
<otherwise>
ORDER BY zr.sort DESC
</otherwise>
</choose>
</where>
</sql>