diff options
author | INOPIAE <inopiae@cacert.org> | 2015-01-13 07:20:30 +0100 |
---|---|---|
committer | INOPIAE <inopiae@cacert.org> | 2015-01-13 07:20:30 +0100 |
commit | a72c7896a6e887efbd9fd91873301e8856d2a36b (patch) | |
tree | f537cc51a7d4378f3ddc6c00f095aa7d69dbe0fa /scripts/cron/refresh_stats.php | |
parent | 22568b513f5e7942718bda57a9ec5650af87b4ca (diff) | |
download | cacert-devel-a72c7896a6e887efbd9fd91873301e8856d2a36b.tar.gz cacert-devel-a72c7896a6e887efbd9fd91873301e8856d2a36b.tar.xz cacert-devel-a72c7896a6e887efbd9fd91873301e8856d2a36b.zip |
bug 1357: replaced calculation of monthly assurer count with new function
Diffstat (limited to 'scripts/cron/refresh_stats.php')
-rwxr-xr-x | scripts/cron/refresh_stats.php | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/scripts/cron/refresh_stats.php b/scripts/cron/refresh_stats.php index c58e907..ae25182 100755 --- a/scripts/cron/refresh_stats.php +++ b/scripts/cron/refresh_stats.php @@ -217,7 +217,9 @@ function getDataFromLive() { $totalcerts = 0; $totalusers = 0; - $totassurers = 0; + $totalcandidates = 0; + $totalassurers = 0; + for($i = date("Y"); $i >= 2002; $i--) { $first_ts = mktime(0, 0, 0, 1, 1, $i); $next_year_ts = mktime(0, 0, 0, 1, 1, $i + 1); @@ -233,14 +235,8 @@ function getDataFromLive() { and `deleted` = 0 and `locked` = 0"); - $totassurers += $assurers = tc( - "select count(*) as `count` from ( - select 1 from `notary` - where `when` >= '$first' and `when` < '$next_year' - and `method`!='Administrative Increase' - and `deleted` = 0 - group by `to` having sum(`points`) >= 100 - ) as `assurer_candidates`"); + $totalcandidates += $candidates = assurer_count($first, $next_year, 0); + $totalassurers += $assurers = assurer_count($first, $next_year, 1); $certs = tc( "select count(*) as `count` from `domaincerts` @@ -267,6 +263,7 @@ function getDataFromLive() { $tmp_arr = array(); $tmp_arr['date'] = $i; $tmp_arr['new_users'] = number_format($users); + $tmp_arr['new_candidates'] = number_format($candidates); $tmp_arr['new_assurers'] = number_format($assurers); $tmp_arr['new_certificates'] = number_format($certs); @@ -274,7 +271,8 @@ function getDataFromLive() { } $stats['growth_last_years_total'] = array( 'new_users' => number_format($totalusers), - 'new_assurers' => number_format($totassurers), + 'new_candidates' => number_format($totalcandidates), + 'new_assurers' => number_format($totalassurers), 'new_certificates' => number_format($totalcerts), ); |