This commit is contained in:
parent
ced8c9f75c
commit
fec363063d
|
@ -114,6 +114,7 @@ def load_authors_by(_, _info, by, limit, offset):
|
||||||
if order in ['likes', 'shouts', 'followers']:
|
if order in ['likes', 'shouts', 'followers']:
|
||||||
q = q.order_by(desc(text(f'{order}_stat')))
|
q = q.order_by(desc(text(f'{order}_stat')))
|
||||||
|
|
||||||
|
q = q.distinct()
|
||||||
q = q.limit(limit).offset(offset)
|
q = q.limit(limit).offset(offset)
|
||||||
|
|
||||||
authors = get_with_stat(q)
|
authors = get_with_stat(q)
|
||||||
|
|
|
@ -454,7 +454,9 @@ async def load_shouts_random_top(_, _info, options):
|
||||||
limit = options.get('limit', 10)
|
limit = options.get('limit', 10)
|
||||||
q = q.group_by(Shout.id).order_by(func.random()).limit(limit)
|
q = q.group_by(Shout.id).order_by(func.random()).limit(limit)
|
||||||
|
|
||||||
return await get_shouts_from_query(q)
|
shouts = await get_shouts_from_query(q)
|
||||||
|
|
||||||
|
return shouts
|
||||||
|
|
||||||
|
|
||||||
@query.field('load_shouts_random_topic')
|
@query.field('load_shouts_random_topic')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user