diff options
Diffstat (limited to 'bin/update-all-reports')
-rwxr-xr-x | bin/update-all-reports | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/update-all-reports b/bin/update-all-reports index e9edae0af..2ede68fe0 100755 --- a/bin/update-all-reports +++ b/bin/update-all-reports @@ -18,6 +18,13 @@ use List::MoreUtils qw(zip); my $fourweeks = 4*7*24*60*60; +# Age problems from when they're confirmed, except on Zurich +# where they appear as soon as they're created. +my $age_column = 'confirmed'; +if ( FixMyStreet->config('BASE_URL') =~ /zurich/ ) { + $age_column = 'created'; +} + my $problems = FixMyStreet::App->model("DB::Problem")->search( { state => [ FixMyStreet::DB::Result::Problem->visible_states() ], @@ -26,7 +33,7 @@ my $problems = FixMyStreet::App->model("DB::Problem")->search( columns => [ 'id', 'bodies_str', 'state', 'areas', { duration => { extract => "epoch from current_timestamp-lastupdate" } }, - { age => { extract => "epoch from current_timestamp-confirmed" } }, + { age => { extract => "epoch from current_timestamp-$age_column" } }, ] } ); |