From 6ba6df5ed320dd7773d0ba1c9f61a7eb7f5cc38f Mon Sep 17 00:00:00 2001 From: beaulaton Date: Wed, 27 Nov 2024 09:58:31 +0100 Subject: [PATCH] little quote --- src/Gateway/QuoteGateway.php | 14 ++++++++------ vue/templates/quoteLittle.html.twig | 10 +++++----- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Gateway/QuoteGateway.php b/src/Gateway/QuoteGateway.php index f04318a..86a33b6 100644 --- a/src/Gateway/QuoteGateway.php +++ b/src/Gateway/QuoteGateway.php @@ -74,12 +74,14 @@ Class QuoteGateway{ public function getQuoteOfTheDay(string $language): array { $query = "SELECT q.id_quote, q.content, c.caracter, i.imgPath, s.title, s.dateS, q.likes, q.langue - FROM Quote q - JOIN Caracter c ON c.id_caracter = q.id_caracter - JOIN Source s ON s.id_source = q.id_source - JOIN Image i ON c.id_img = i.id_img - WHERE q.isValide = true AND q.isCitationDuJour = true AND q.langue = :language - ORDER BY id_quote DESC LIMIT 1;"; + FROM DailyQuote dq + JOIN Quote q ON dq.citation_id = q.id_quote + JOIN Caracter c ON c.id_caracter = q.id_caracter + JOIN Source s ON s.id_source = q.id_source + JOIN Image i ON c.id_img = i.id_img + WHERE q.isValide = true AND q.langue = :language + ORDER BY q.id_quote DESC + LIMIT 1;"; try { $this->con->executeQuery($query, [':language' => [$language, PDO::PARAM_STR]]); $result = $this->con->getResults(); diff --git a/vue/templates/quoteLittle.html.twig b/vue/templates/quoteLittle.html.twig index bc9f397..bfeacb6 100644 --- a/vue/templates/quoteLittle.html.twig +++ b/vue/templates/quoteLittle.html.twig @@ -2,14 +2,14 @@ {% if quotes|length > 0 %}
{% for quote in quotes %} - +
- {{ quote.caracter }} + {{ quote.carac }}

"{{ quote.content }}"

-

- {{ quote.title }}

-

Personnage : {{ quote.caracter }}

-

Année : {{ quote.dates }}

+

- {{ quote.titleSrc }}

+

Personnage : {{ quote.carac }}

+

Année : {{ quote.dateSrc }}