summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Dörre <felix@dogcraft.de>2015-02-24 23:53:53 +0100
committerFelix Dörre <felix@dogcraft.de>2015-02-25 00:20:36 +0100
commit7ad2ae283710f934e73e26baf8e279cc0f462620 (patch)
treef12d307afa9947c4ddc4f6808c941265832a07c4
parent21a7023d57d54c2245a51814c91391abf0790b39 (diff)
downloadcacert-devel-7ad2ae283710f934e73e26baf8e279cc0f462620.tar.gz
cacert-devel-7ad2ae283710f934e73e26baf8e279cc0f462620.tar.xz
cacert-devel-7ad2ae283710f934e73e26baf8e279cc0f462620.zip
bug-1051: Update some SQL queries in stats to new points calculation
-rwxr-xr-xscripts/cron/refresh_stats.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/cron/refresh_stats.php b/scripts/cron/refresh_stats.php
index 3b446ba..6619b29 100755
--- a/scripts/cron/refresh_stats.php
+++ b/scripts/cron/refresh_stats.php
@@ -124,7 +124,7 @@ function getDataFromLive() {
select 1 from `notary`
where `deleted` = 0
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(
@@ -132,13 +132,13 @@ function getDataFromLive() {
select 1 from `notary`
where `deleted` = 0
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`
+ select sum(`awarded`) from `notary`
where `to`=`users`.`id`
and `deleted` = 0
) >= 100
@@ -153,7 +153,7 @@ function getDataFromLive() {
$stats['aussurers_with_test'] = number_format(tc(
"select count(*) as `count` from `users`
where (
- select sum(`points`) from `notary`
+ select sum(`awarded`) from `notary`
where `to`=`users`.`id`
and `deleted` = 0
) >= 100
@@ -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(