[freeside-commits] branch master updated. f0842371ad319e9423fba20ea5b013dbbf449525

Ivan ivan at 420.am
Tue Jun 12 15:30:17 PDT 2012


The branch, master has been updated
       via  f0842371ad319e9423fba20ea5b013dbbf449525 (commit)
      from  43e2b6f17c5a5d49fcb553f6792b6d306be04d75 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f0842371ad319e9423fba20ea5b013dbbf449525
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Jun 12 15:30:13 2012 -0700

    formatting nits

diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index 8a6fa3b..75859c3 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -781,7 +781,14 @@ sub search {
 
     if ($dbh->{Driver}->{Name} eq 'Pg') {
 
-      push @select, "array_to_string(array(select pkg from cust_pkg left join part_pkg using ( pkgpart ) where cust_main.custnum = cust_pkg.custnum $pkgwhere),'|') as magic";
+      push @select, "
+        ARRAY_TO_STRING(
+          ARRAY(
+            SELECT pkg FROM cust_pkg LEFT JOIN part_pkg USING ( pkgpart )
+              WHERE cust_main.custnum = cust_pkg.custnum $pkgwhere
+          ), '|'
+        ) AS magic
+      ";
 
     } elsif ($dbh->{Driver}->{Name} =~ /^mysql/i) {
       push @select, "GROUP_CONCAT(part_pkg.pkg SEPARATOR '|') as magic";
@@ -792,7 +799,11 @@ sub search {
            "omitting package information from report.";
     }
 
-    my $header_query = "SELECT COUNT(cust_pkg.custnum = cust_main.custnum) AS count FROM cust_main $addl_from $extra_sql $pkgwhere group by cust_main.custnum order by count desc limit 1";
+    my $header_query = "
+      SELECT COUNT(cust_pkg.custnum = cust_main.custnum) AS count
+        FROM cust_main $addl_from $extra_sql $pkgwhere
+          GROUP BY cust_main.custnum ORDER BY count DESC LIMIT 1
+    ";
 
     my $sth = dbh->prepare($header_query) or die dbh->errstr;
     $sth->execute() or die $sth->errstr;

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_main/Search.pm |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list