]> Raphaël G. Git Repositories - blogbundle/commitdiff
Makes created, updated and modified the greatest of each
authorRaphaël Gertz <git@rapsys.eu>
Tue, 12 Dec 2023 17:41:51 +0000 (18:41 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Tue, 12 Dec 2023 17:41:51 +0000 (18:41 +0100)
Repository/ArticleRepository.php

index 0d5a069bf7b014436a8dd12299e6e4b936c5ca44..a19d63c8f9d989a53b7043065b8a9be8899d7a05 100644 (file)
@@ -166,9 +166,9 @@ SQL;
                $req = <<<SQL
 SELECT
        b.id,
-       b.created,
-       b.updated,
-       b.modified,
+       GREATEST(b.created, kat.created) AS created,
+       GREATEST(b.updated, kat.updated) AS updated,
+       GREATEST(b.created, b.updated, kat.created, kat.updated) AS modified,
        b.body,
        b.description,
        b.slug,
@@ -184,7 +184,6 @@ FROM (
                a.id,
                GREATEST(a.created, at.created, k.created, kt.created) AS created,
                GREATEST(a.updated, at.updated, k.updated, kt.updated) AS updated,
-               GREATEST(a.created, at.created, k.created, kt.created, a.updated, at.updated, k.updated, kt.updated) AS modified,
                at.body,
                at.description,
                at.slug,