Skip to content

Commit

Permalink
Merge pull request mautic#7494 from inkas/speed-up-leads-custom-fields
Browse files Browse the repository at this point in the history
Speed up leads custom fields
  • Loading branch information
dennisameling authored Mar 18, 2020
2 parents 9515d23 + 21efe40 commit 61a16e4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions app/bundles/LeadBundle/Entity/CustomFieldRepositoryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,7 @@ public function getEntitiesWithCustomFields($object, $args, $resultsCallback = n
//since we have to be cross-platform; it's way ugly

//We should probably totally ditch orm for leads
$order = '(CASE';
foreach ($ids as $count => $id) {
$order .= ' WHEN '.$this->getTableAlias().'.id = '.$id.' THEN '.$count;
++$count;
}
$order .= ' ELSE '.$count.' END) AS HIDDEN ORD';
$order = $this->getTableAlias().'.id AS HIDDEN ORD';

//ORM - generates lead entities
/** @var \Doctrine\ORM\QueryBuilder $q */
Expand Down

0 comments on commit 61a16e4

Please sign in to comment.