exclude users spent sats from their stacked count

This commit is contained in:
keyan 2022-01-19 10:36:00 -06:00
parent 129ec89b68
commit 7d4324eb33
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ export default {
FROM "ItemAct" FROM "ItemAct"
JOIN "Item" on "ItemAct"."itemId" = "Item".id JOIN "Item" on "ItemAct"."itemId" = "Item".id
JOIN users on "Item"."userId" = users.id JOIN users on "Item"."userId" = users.id
WHERE act <> 'BOOST' AND "ItemAct".created_at <= $1 WHERE act <> 'BOOST' AND "ItemAct"."userId" <> users.id AND "ItemAct".created_at <= $1
${topClause(within)} ${topClause(within)}
GROUP BY users.id, users.name GROUP BY users.id, users.name
ORDER BY stacked DESC NULLS LAST, users.created_at DESC ORDER BY stacked DESC NULLS LAST, users.created_at DESC