правки
This commit is contained in:
@@ -102,16 +102,14 @@ async def get_placements_analytics(
|
|||||||
allowed_project_ids=allowed_project_ids,
|
allowed_project_ids=allowed_project_ids,
|
||||||
)
|
)
|
||||||
|
|
||||||
placement_post_ids = [p.id for p in placements]
|
# Extract placement_post_ids and post_ids from placement.placement_posts
|
||||||
post_ids = (
|
placement_post_ids = [pp.id for p in placements for pp in p.placement_posts]
|
||||||
[
|
post_ids = [
|
||||||
p.post.id
|
pp.post.id
|
||||||
for p in placements
|
for p in placements
|
||||||
if hasattr(p, 'placement_posts') and p.placement_posts and p.placement_posts[0].post
|
for pp in p.placement_posts
|
||||||
]
|
if pp.post
|
||||||
if placements
|
]
|
||||||
else []
|
|
||||||
)
|
|
||||||
views_map = await self.database.get_latest_views_data_batch(post_ids) if post_ids else {}
|
views_map = await self.database.get_latest_views_data_batch(post_ids) if post_ids else {}
|
||||||
subscriptions_counts = (
|
subscriptions_counts = (
|
||||||
await self.database.count_subscriptions_by_placement_post_batch(placement_post_ids)
|
await self.database.count_subscriptions_by_placement_post_batch(placement_post_ids)
|
||||||
|
|||||||
Reference in New Issue
Block a user