Skip to content
Snippets Groups Projects
Commit 7e70b719 authored by Mariusz Trela's avatar Mariusz Trela
Browse files

Small fixes

parent d4cf2cab
No related branches found
No related tags found
4 merge requests!456Release candidate v1 24,!230Setup monitoring with pghero,!135Enable postgres monitoring on CI server,!61Issue #47 - test database_api get_payout_stats fail
...@@ -304,7 +304,7 @@ class Posts: ...@@ -304,7 +304,7 @@ class Posts:
author, author,
permlink, permlink,
"NULL" if ( total_payout_value is None ) else ( "'{}'".format( legacy_amount(total_payout_value) ) ), "NULL" if ( total_payout_value is None ) else ( "'{}'".format( legacy_amount(total_payout_value) ) ),
"NULL" if ( curators_vesting_payout is None ) else ( "'{}'".format( legacy_amount(curators_vesting_payout) ) ), #curator_payout_value "NULL" if ( curator_payout_value is None ) else ( "'{}'".format( legacy_amount(curator_payout_value) ) ),
"NULL" if ( author_rewards is None ) else author_rewards, "NULL" if ( author_rewards is None ) else author_rewards,
"NULL" if ( author_rewards_hive is None ) else author_rewards_hive, "NULL" if ( author_rewards_hive is None ) else author_rewards_hive,
"NULL" if ( author_rewards_hbd is None ) else author_rewards_hbd, "NULL" if ( author_rewards_hbd is None ) else author_rewards_hbd,
......
...@@ -29,10 +29,10 @@ async def get_trending_tags(context, start_tag: str = '', limit: int = 250): ...@@ -29,10 +29,10 @@ async def get_trending_tags(context, start_tag: str = '', limit: int = 250):
if start_tag: if start_tag:
seek = """ seek = """
HAVING SUM(payout) <= ( HAVING SUM(payout + pending_payout) <= (
SELECT SUM(payout) SELECT SUM(payout + pending_payout)
FROM hive_posts FROM hive_posts
WHERE is_paidout = '0' WHERE is_paidout = '0' and is_deleted = false
AND category_id = (SELECT id FROM hive_category_data WHERE category = :start_tag)) AND category_id = (SELECT id FROM hive_category_data WHERE category = :start_tag))
""" """
else: else:
...@@ -42,11 +42,11 @@ async def get_trending_tags(context, start_tag: str = '', limit: int = 250): ...@@ -42,11 +42,11 @@ async def get_trending_tags(context, start_tag: str = '', limit: int = 250):
SELECT (SELECT category FROM hive_category_data WHERE id = category_id) as category, SELECT (SELECT category FROM hive_category_data WHERE id = category_id) as category,
COUNT(*) AS total_posts, COUNT(*) AS total_posts,
SUM(CASE WHEN depth = 0 THEN 1 ELSE 0 END) AS top_posts, SUM(CASE WHEN depth = 0 THEN 1 ELSE 0 END) AS top_posts,
SUM(payout) AS total_payouts SUM(payout + pending_payout) AS total_payouts
FROM hive_posts FROM hive_posts
WHERE is_paidout = '0' WHERE is_paidout = '0' and is_deleted = false
GROUP BY category %s GROUP BY category %s
ORDER BY SUM(payout) DESC ORDER BY SUM(payout + pending_payout) DESC
LIMIT :limit LIMIT :limit
""" % seek """ % seek
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment