summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2015-04-29 15:10:08 +0200
committerBenny Baumann <BenBE@geshi.org>2015-04-29 15:10:08 +0200
commit5d64059340c696a09a9d1b013fc381ccd5354967 (patch)
treefbe4a5467e0ae2f55c5751876bc0a655e6b2f1cf
parent98d88dac5ecf429411385dce42af6c78382ec5bf (diff)
parent532c4e7d06f7e30d7f1a4e99020d315aa948764a (diff)
downloadcacert-devel-5d64059340c696a09a9d1b013fc381ccd5354967.tar.gz
cacert-devel-5d64059340c696a09a9d1b013fc381ccd5354967.tar.xz
cacert-devel-5d64059340c696a09a9d1b013fc381ccd5354967.zip
Merge branch 'bug-1051' into bug-1042
-rwxr-xr-xscripts/cron/refresh_stats.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/scripts/cron/refresh_stats.php b/scripts/cron/refresh_stats.php
index 3b446ba..2d6b2de 100755
--- a/scripts/cron/refresh_stats.php
+++ b/scripts/cron/refresh_stats.php
@@ -122,24 +122,24 @@ function getDataFromLive() {
$stats['users_1to49'] = number_format(tc(
"select count(*) as `count` from (
select 1 from `notary`
- where `deleted` = 0
+ where `deleted` = 0 AND `method` != 'Administrative Increase' AND `from` != `to`
group by `to`
- having sum(`points`) > 0 and sum(`points`) < 50
+ having sum(`awarded`) > 0 and sum(`awarded`) < 50
) as `low_points`"));
$stats['users_50to99'] = number_format(tc(
"select count(*) as `count` from (
select 1 from `notary`
- where `deleted` = 0
+ where `deleted` = 0 AND `method` != 'Administrative Increase' AND `from` != `to`
group by `to`
- having sum(`points`) >= 50 and sum(`points`) < 100
+ having sum(`awarded`) >= 50 and sum(`awarded`) < 100
) as `high_points`"));
$stats['assurer_candidates'] = number_format(tc(
"select count(*) as `count` from `users`
where (
- select sum(`points`) from `notary`
- where `to`=`users`.`id`
+ select sum(`awarded`) from `notary`
+ where `to`=`users`.`id` AND `method` != 'Administrative Increase' AND `from` != `to`
and `deleted` = 0
) >= 100
and not exists(
@@ -153,8 +153,8 @@ function getDataFromLive() {
$stats['aussurers_with_test'] = number_format(tc(
"select count(*) as `count` from `users`
where (
- select sum(`points`) from `notary`
- where `to`=`users`.`id`
+ select sum(`awarded`) from `notary`
+ where `to`=`users`.`id` AND `method` != 'Administrative Increase' AND `from` != `to`
and `deleted` = 0
) >= 100
and exists(
@@ -194,7 +194,7 @@ function getDataFromLive() {
where `when` >= '$first' and `when` < '$next_month'
and `method`!='Administrative Increase'
and `deleted` = 0
- group by `to` having sum(`points`) >= 100
+ group by `to` having sum(`awarded`) >= 100
) as `assurer_candidates`");
$certs = tc(
@@ -257,7 +257,7 @@ function getDataFromLive() {
where `when` >= '$first' and `when` < '$next_year'
and `method`!='Administrative Increase'
and `deleted` = 0
- group by `to` having sum(`points`) >= 100
+ group by `to` having sum(`awarded`) >= 100
) as `assurer_candidates`");
$certs = tc(