aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Script
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/Script')
-rw-r--r--perllib/FixMyStreet/Script/Questionnaires.pm4
-rwxr-xr-xperllib/FixMyStreet/Script/UpdateAllReports.pm4
2 files changed, 4 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/Script/Questionnaires.pm b/perllib/FixMyStreet/Script/Questionnaires.pm
index aab4b9b75..5db66ff7c 100644
--- a/perllib/FixMyStreet/Script/Questionnaires.pm
+++ b/perllib/FixMyStreet/Script/Questionnaires.pm
@@ -33,8 +33,8 @@ sub send_questionnaires_period {
};
$q_params->{'-or'} = [
- '(select max(whensent) from questionnaire where me.id=problem_id)' => undef,
- '(select max(whenanswered) from questionnaire where me.id=problem_id)' => { '<', \"current_timestamp - '$period'::interval" }
+ \'(select max(whensent) from questionnaire where me.id=problem_id) IS NULL',
+ \"(select max(whenanswered) from questionnaire where me.id=problem_id) < current_timestamp - '$period'::interval",
];
my $unsent = FixMyStreet::DB->resultset('Problem')->search( $q_params, {
diff --git a/perllib/FixMyStreet/Script/UpdateAllReports.pm b/perllib/FixMyStreet/Script/UpdateAllReports.pm
index 33665b9da..b23ed5b6a 100755
--- a/perllib/FixMyStreet/Script/UpdateAllReports.pm
+++ b/perllib/FixMyStreet/Script/UpdateAllReports.pm
@@ -36,8 +36,8 @@ sub generate {
{
columns => [
'id', 'bodies_str', 'state', 'areas', 'cobrand', 'category',
- { duration => { extract => "epoch from current_timestamp-lastupdate" } },
- { age => { extract => "epoch from current_timestamp-$age_column" } },
+ { duration => { extract => \"epoch from current_timestamp-lastupdate" } },
+ { age => { extract => \"epoch from current_timestamp-$age_column" } },
]
}
);