X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/98d9c3dc2b46ac796418794aae53b20925d45a8b..ed0a31d7a909f78a031e955c87ae55323b6f7ba8:/Repository/UserRepository.php diff --git a/Repository/UserRepository.php b/Repository/UserRepository.php index 4e7dae8..725e3ed 100644 --- a/Repository/UserRepository.php +++ b/Repository/UserRepository.php @@ -218,9 +218,9 @@ SELECT c.title AS c_title, u.country_id AS o_id, o.title AS o_title, + GREATEST(u.created, u.updated, COALESCE(c.created, '1970-01-01'), COALESCE(c.updated, '1970-01-01'), COALESCE(o.created, '1970-01-01'), COALESCE(o.updated, '1970-01-01'), COALESCE(g.created, '1970-01-01'), COALESCE(g.updated, '1970-01-01')) AS modified, GROUP_CONCAT(g.id ORDER BY g.id SEPARATOR "\\n") AS ids, - GROUP_CONCAT(g.title ORDER BY g.id SEPARATOR "\\n") AS titles, - GREATEST(COALESCE(u.updated, 0), COALESCE(c.updated, 0), COALESCE(o.updated, 0)) AS modified + GROUP_CONCAT(g.title ORDER BY g.id SEPARATOR "\\n") AS titles FROM Rapsys\AirBundle\Entity\User AS u LEFT JOIN Rapsys\AirBundle\Entity\Civility AS c ON (c.id = u.civility_id) LEFT JOIN Rapsys\AirBundle\Entity\Country AS o ON (o.id = u.country_id) @@ -252,11 +252,11 @@ SQL; ->addScalarResult('c_title', 'c_title', 'string') ->addScalarResult('o_id', 'o_id', 'integer') ->addScalarResult('o_title', 'o_title', 'string') + ->addScalarResult('modified', 'modified', 'datetime') //XXX: is a string because of \n separator ->addScalarResult('ids', 'ids', 'string') //XXX: is a string because of \n separator ->addScalarResult('titles', 'titles', 'string') - ->addScalarResult('modified', 'modified', 'datetime') ->addIndexByScalar('id'); //Get result