[freeside-commits] freeside/FS/FS/cust_main Search.pm,1.4,1.5
Mark Wells
mark at wavetail.420.am
Wed Nov 3 22:57:02 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS/cust_main
In directory wavetail.420.am:/tmp/cvs-serv27552/FS/FS/cust_main
Modified Files:
Search.pm
Log Message:
clean up postgres-isms, RT#10324
Index: Search.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main/Search.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -d -r1.4 -r1.5
--- Search.pm 31 Oct 2010 19:12:52 -0000 1.4
+++ Search.pm 4 Nov 2010 05:56:59 -0000 1.5
@@ -541,11 +541,13 @@
"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";
}
More information about the freeside-commits
mailing list