refactor, удалены интерфейс БД из-за слабой необходимости
This commit is contained in:
@@ -233,7 +233,6 @@ async def get_projects_analytics(
|
||||
total_metrics.total_subscriptions += subs_count
|
||||
total_metrics.clicks_count += subs_count
|
||||
|
||||
views_count = 0
|
||||
if publication.post and publication.post.id in views_map:
|
||||
views_count = views_map[publication.post.id][0]
|
||||
pd.total_views += views_count
|
||||
@@ -245,7 +244,9 @@ async def get_projects_analytics(
|
||||
placement = publication.placement
|
||||
if placement and placement.cost_before_bargain and placement.cost_before_bargain > cost:
|
||||
discount = placement.cost_before_bargain - cost
|
||||
discount_percent = (discount / placement.cost_before_bargain) * 100 if placement.cost_before_bargain > 0 else 0.0
|
||||
discount_percent = (
|
||||
(discount / placement.cost_before_bargain) * 100 if placement.cost_before_bargain > 0 else 0.0
|
||||
)
|
||||
|
||||
pd.total_discounts += discount
|
||||
pd.discount_count += 1
|
||||
@@ -296,4 +297,3 @@ async def get_projects_analytics(
|
||||
totals = _calculate_metrics(total_metrics, input.metrics)
|
||||
|
||||
return dto.GetProjectsAnalyticsOutput(periods=periods, totals=totals)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user