fix nrbuilds query

This commit is contained in:
Rob Vermaas 2011-11-01 21:35:02 -04:00
parent ab81ce689d
commit 13df3e4191

View file

@ -189,7 +189,7 @@ sub nrbuilds : Chained('api') PathPart('nrbuilds') Args(0) {
$base = 60*60 if($period eq "hour"); $base = 60*60 if($period eq "hour");
$base = 24*60*60 if($period eq "day"); $base = 24*60*60 if($period eq "day");
my @stats = $c->model('DB::Builds')->search($filter, {select => ["count(*)"], as => ["nr"], group_by => ["timestamp - timestamp % $base"], order_by => "timestamp - timestamp % $base DESC", rows => $nr}) ; my @stats = $c->model('DB::Builds')->search($filter, {select => [{ count => "*" }], as => ["nr"], group_by => ["timestamp - timestamp % $base"], order_by => "timestamp - timestamp % $base DESC", rows => $nr}) ;
my @arr ; my @arr ;
foreach my $d (@stats) { foreach my $d (@stats) {
push @arr, int($d->get_column("nr")); push @arr, int($d->get_column("nr"));