mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
better monthly stats info
This commit is contained in:
parent
233b6f758a
commit
2ef7668595
1 changed files with 3 additions and 5 deletions
|
@ -42,11 +42,9 @@ get '/admin/usage' do
|
||||||
|
|
||||||
month = current_month
|
month = current_month
|
||||||
|
|
||||||
until month.year == 2015 && month.month == 1 do
|
until month.year == 2016 && month.month == 2 do
|
||||||
stats = DB[
|
|
||||||
'select sum(views) as views, sum(hits) as hits, sum(bandwidth) as bandwidth from stats where created_at >= ? and created_at < ?',
|
stats = DB["select sum(views) as views, sum(hits) as hits,sum(bandwidth) as bandwidth from daily_site_stats where created_at::text LIKE '#{month.year}-#{month.strftime('%m')}-%'"].first
|
||||||
month,
|
|
||||||
month.next_month].first
|
|
||||||
|
|
||||||
stats.keys.each do |key|
|
stats.keys.each do |key|
|
||||||
stats[key] ||= 0
|
stats[key] ||= 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue