fix rewards to also pay post tippers

This commit is contained in:
keyan 2023-07-23 09:00:02 -05:00
parent a0874c6c52
commit 512b9257d2
1 changed files with 1 additions and 1 deletions

View File

@ -79,7 +79,7 @@ function earn ({ models }) {
GROUP BY "userId", "parentId" IS NULL
)
SELECT "userId", NULL as id, type, ROW_NUMBER() OVER (PARTITION BY "isPost" ORDER BY upvoter_ratio DESC) as rank,
upvoter_ratio/(sum(upvoter_ratio) OVER (PARTITION BY "isPost")) as proportion
upvoter_ratio/(sum(upvoter_ratio) OVER (PARTITION BY "isPost"))/2 as proportion
FROM upvoter_ratios
WHERE upvoter_ratio > 0`)