Skip to content

Commit 031f890

Browse files
committed
fix misplaced bracket
1 parent 5eddc57 commit 031f890

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/algora/analytics/analytics.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ defmodule Algora.Analytics do
4545
u.id
4646
|> count()
4747
|> filter(
48-
u.inserted_at < ^from and u.inserted_at >= ^period_start and (u.status == :active or u.status == :paid)
48+
(u.status == :active or u.status == :paid) and u.inserted_at < ^from and u.inserted_at >= ^period_start
4949
),
5050
success_previous:
5151
u.id
5252
|> count()
5353
|> filter(
54-
u.inserted_at < ^period_start and u.inserted_at >= ^previous_period_start and
55-
(u.status == :active or u.status == :paid)
54+
(u.status == :active or u.status == :paid) and
55+
u.inserted_at < ^period_start and u.inserted_at >= ^previous_period_start
5656
)
5757
}
5858

@@ -69,7 +69,7 @@ defmodule Algora.Analytics do
6969
joined_at: u.inserted_at,
7070
total_contracts: c.id |> count() |> filter(c.inserted_at >= ^period_start),
7171
successful_contracts:
72-
c.id |> count() |> filter(c.status == :active or (c.status == :paid and c.inserted_at >= ^period_start)),
72+
c.id |> count() |> filter((c.status == :active or c.status == :paid) and c.inserted_at >= ^period_start),
7373
last_active_at: u.updated_at,
7474
avatar_url: u.avatar_url
7575
}

0 commit comments

Comments
 (0)