summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authormark <mark>2010-11-04 05:57:00 +0000
committermark <mark>2010-11-04 05:57:00 +0000
commitbd35baff8b7b5dcdd44d14a1139ef4d48009274c (patch)
treea727a7ef414a242fad7ddb3cd1eda6533f97f14b /FS
parent2ecef68b926eae756524a564bd0986da7b56109f (diff)
clean up postgres-isms, RT#10324
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_main/Search.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index b9a30a552..ac170ff1f 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -541,11 +541,13 @@ sub search {
"cust_main.$field >= $beginning",
"cust_main.$field <= $ending";
- # XXX: do this for mysql and/or pull it out of here
if(defined $hour) {
- if ($dbh->{Driver}->{Name} eq 'Pg') {
+ if ($dbh->{Driver}->{Name} =~ /Pg/i) {
push @where, "extract(hour from to_timestamp(cust_main.$field)) = $hour";
}
+ elsif( $dbh->{Driver}->{Name} =~ /mysql/i) {
+ push @where, "hour(from_unixtime(cust_main.$field)) = $hour"
+ }
else {
warn "search by time of day not supported on ".$dbh->{Driver}->{Name}." databases";
}