From 7759697d8a7841ce24fe0a38824197e1fef8f5ee Mon Sep 17 00:00:00 2001 From: Morven Lewis-Everley Date: Thu, 10 Sep 2020 08:46:17 +0100 Subject: [PATCH] Strip quotes from locationscount --- src/model/Contact.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/model/Contact.php b/src/model/Contact.php index 8c9abc0..0d1d890 100644 --- a/src/model/Contact.php +++ b/src/model/Contact.php @@ -248,7 +248,7 @@ public static function getByMostLocations() ->setSelect('"Contact"."ID", count("ContactLocation"."ID") as LocationsCount') ->addLeftJoin('ContactLocation', '"Contact"."ID" = "ContactLocation"."ContactID"') ->addGroupBy('"Contact"."ID"') - ->addOrderBy('"LocationsCount"', 'DESC') + ->addOrderBy('LocationsCount', 'DESC') ->setLimit(1); foreach ($query->execute() as $row) {