Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
7e70b719
Commit
7e70b719
authored
4 years ago
by
Mariusz Trela
Browse files
Options
Downloads
Patches
Plain Diff
Small fixes
parent
d4cf2cab
No related branches found
No related tags found
4 merge requests
!456
Release candidate v1 24
,
!230
Setup monitoring with pghero
,
!135
Enable postgres monitoring on CI server
,
!61
Issue #47 - test database_api get_payout_stats fail
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hive/indexer/posts.py
+1
-1
1 addition, 1 deletion
hive/indexer/posts.py
hive/server/condenser_api/tags.py
+6
-6
6 additions, 6 deletions
hive/server/condenser_api/tags.py
with
7 additions
and
7 deletions
hive/indexer/posts.py
+
1
−
1
View file @
7e70b719
...
@@ -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
(
curator
s_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
,
...
...
This diff is collapsed.
Click to expand it.
hive/server/condenser_api/tags.py
+
6
−
6
View file @
7e70b719
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment