This commit is contained in:
Leo
2026-01-16 18:07:24 +08:00
parent 18f541fdf7
commit 3336eeb6aa
4 changed files with 17 additions and 2 deletions

View File

@@ -46,7 +46,8 @@
select
count(*) as totalCount,
sum(case when is_use = 0 then 1 else 0 end) as availableCount,
sum(case when is_use = 1 then 1 else 0 end) as usedCount
sum(case when is_use = 1 then 1 else 0 end) as usedCount,
(select max(created_at) from comments where product_id = #{productId}) as lastCommentUpdateTime
from comments
where product_id = #{productId}
</select>