mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Fix cvstats query
This commit is contained in:
parent
d2c5b11682
commit
33ce001a6f
1 changed files with 3 additions and 9 deletions
|
@ -63,9 +63,7 @@ JOIN
|
||||||
AVG(c.members_total) members_total,
|
AVG(c.members_total) members_total,
|
||||||
AVG(c.users_total) users_total
|
AVG(c.users_total) users_total
|
||||||
FROM cvstats c
|
FROM cvstats c
|
||||||
WHERE c.timestamp BETWEEN
|
WHERE c.timestamp > current_timestamp - interval '7 day'
|
||||||
NOW()::DATE-EXTRACT(DOW FROM NOW())::INTEGER-7
|
|
||||||
AND NOW()::DATE-EXTRACT(DOW from NOW())::INTEGER
|
|
||||||
GROUP BY h
|
GROUP BY h
|
||||||
) c
|
) c
|
||||||
GROUP BY ph
|
GROUP BY ph
|
||||||
|
@ -92,9 +90,7 @@ JOIN
|
||||||
AVG(c.members_total) members_total,
|
AVG(c.members_total) members_total,
|
||||||
AVG(c.users_total) users_total
|
AVG(c.users_total) users_total
|
||||||
FROM cvstats c
|
FROM cvstats c
|
||||||
WHERE c.timestamp BETWEEN
|
WHERE c.timestamp > current_timestamp - interval '30 day'
|
||||||
NOW()::DATE-EXTRACT(DOW FROM NOW())::INTEGER-30
|
|
||||||
AND NOW()::DATE-EXTRACT(DOW from NOW())::INTEGER
|
|
||||||
GROUP BY h
|
GROUP BY h
|
||||||
) c
|
) c
|
||||||
GROUP BY ph
|
GROUP BY ph
|
||||||
|
@ -121,9 +117,7 @@ JOIN
|
||||||
AVG(c.members_total) members_total,
|
AVG(c.members_total) members_total,
|
||||||
AVG(c.users_total) users_total
|
AVG(c.users_total) users_total
|
||||||
FROM cvstats c
|
FROM cvstats c
|
||||||
WHERE c.timestamp BETWEEN
|
WHERE c.timestamp > current_timestamp - interval '1 day'
|
||||||
NOW()::DATE-EXTRACT(DOW FROM NOW())::INTEGER-1
|
|
||||||
AND NOW()::DATE-EXTRACT(DOW from NOW())::INTEGER
|
|
||||||
GROUP BY h
|
GROUP BY h
|
||||||
) c
|
) c
|
||||||
GROUP BY ph
|
GROUP BY ph
|
||||||
|
|
Loading…
Reference in a new issue