mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-04-22 11:57:29 +08:00
修复收到的点赞显示异常问题
This commit is contained in:
@@ -31,12 +31,17 @@ public interface ReactionRepository extends JpaRepository<Reaction, Long> {
|
|||||||
long countByUserAfter(@Param("username") String username, @Param("start") java.time.LocalDateTime start);
|
long countByUserAfter(@Param("username") String username, @Param("start") java.time.LocalDateTime start);
|
||||||
|
|
||||||
@Query("""
|
@Query("""
|
||||||
SELECT COUNT(r) FROM Reaction r
|
SELECT COUNT(DISTINCT r.id)
|
||||||
LEFT JOIN r.post p
|
FROM Reaction r
|
||||||
|
LEFT JOIN r.post p
|
||||||
|
LEFT JOIN p.author pa
|
||||||
LEFT JOIN r.comment c
|
LEFT JOIN r.comment c
|
||||||
WHERE r.type = com.openisle.model.ReactionType.LIKE AND
|
LEFT JOIN c.author ca
|
||||||
((p IS NOT NULL AND p.author.username = :username) OR
|
WHERE r.type = com.openisle.model.ReactionType.LIKE
|
||||||
(c IS NOT NULL AND c.author.username = :username))
|
AND (
|
||||||
|
(r.post IS NOT NULL AND pa.username = :username)
|
||||||
|
OR (r.comment IS NOT NULL AND ca.username = :username)
|
||||||
|
)
|
||||||
""")
|
""")
|
||||||
long countLikesReceived(@Param("username") String username);
|
long countLikesReceived(@Param("username") String username);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user