From 4e510e5882b1a6ac98bbee7708d1d02367c76bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Fern=C3=A1ndez?= Date: Wed, 3 Jul 2024 13:38:30 +0200 Subject: [PATCH] Tarea #3117 - Evitar usar la serie rectificativa --- Lib/Random/NewItems.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Lib/Random/NewItems.php b/Lib/Random/NewItems.php index f27fba3..29bd77f 100644 --- a/Lib/Random/NewItems.php +++ b/Lib/Random/NewItems.php @@ -226,10 +226,13 @@ protected static function codserie(): ?string if (null === self::$series) { $serie = new Serie(); $codserieRec = Tools::settings('default', 'codserierec'); - $where = [new DataBaseWhere('codserie', $codserieRec, '!=')]; - self::$series = empty($codserieRec) ? - $serie->all() : - $serie->all($where); + $where = [new DataBaseWhere('tipo', 'R', '!=')]; + + if (false === empty($codserieRec)) { + $where[] = new DataBaseWhere('codserie', $codserieRec, '!='); + } + + self::$series = $serie->all($where); } shuffle(self::$series);