get-shouts-with-stats-fix3
This commit is contained in:
parent
4aec829c74
commit
d48577b191
|
@ -207,10 +207,8 @@ def get_shouts_with_stats(q, limit=50, offset=0, author_id=None):
|
||||||
func.count(func.distinct(Reaction.id)).label("comments_stat"),
|
func.count(func.distinct(Reaction.id)).label("comments_stat"),
|
||||||
func.sum(
|
func.sum(
|
||||||
case(
|
case(
|
||||||
[
|
(Reaction.kind == ReactionKind.LIKE.value, 1),
|
||||||
(Reaction.kind == "LIKE", 1),
|
(Reaction.kind == ReactionKind.DISLIKE.value, -1),
|
||||||
(Reaction.kind == "DISLIKE", -1)
|
|
||||||
],
|
|
||||||
else_=0
|
else_=0
|
||||||
)
|
)
|
||||||
).label("rating_stat"),
|
).label("rating_stat"),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user