Merge pull request #12993 from eileenmcnaughton/strtolower_mailing
[civicrm-core.git] / api / v3 / MailingContact.php
index b0fd28e891c28b1f566352b42a1dab66660f2982..174eae6b791d9daa992c267375c8e53ac5f406c2 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.7                                                |
+ | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2017                                |
  +--------------------------------------------------------------------+
@@ -159,7 +159,7 @@ GROUP BY   m.id
     }
     $select = implode(', ', $select);
 
-    $orderBy = 'ORDER BY j.start_date DESC';
+    $orderBy = 'ORDER BY MIN(j.start_date) DESC';
     if ($sort) {
       $orderBy = "ORDER BY $sort";
     }