From 7661734ed296654630f3668132671117519145dd Mon Sep 17 00:00:00 2001 From: Yassine Doghri Date: Thu, 15 Oct 2020 10:06:11 +0000 Subject: [PATCH] fix: add where condition to get episode count without deleted episodes contain podcast page header info within an md width fixes #67 --- app/Models/EpisodeModel.php | 7 ++++++- app/Views/podcast.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Models/EpisodeModel.php b/app/Models/EpisodeModel.php index 95ca8abb..1bd2440b 100644 --- a/app/Models/EpisodeModel.php +++ b/app/Models/EpisodeModel.php @@ -199,7 +199,11 @@ class EpisodeModel extends Model $found = $this->select( 'YEAR(published_at) as year, count(*) as number_of_episodes' ) - ->where(['podcast_id' => $podcastId, 'season_number' => null]) + ->where([ + 'podcast_id' => $podcastId, + 'season_number' => null, + $this->deletedField => null, + ]) ->groupBy('year') ->orderBy('year', 'DESC') ->get() @@ -220,6 +224,7 @@ class EpisodeModel extends Model ->where([ 'podcast_id' => $podcastId, 'season_number is not' => null, + $this->deletedField => null, ]) ->groupBy('season_number') ->orderBy('season_number', 'ASC') diff --git a/app/Views/podcast.php b/app/Views/podcast.php index f64a2157..e2f6fa7b 100644 --- a/app/Views/podcast.php +++ b/app/Views/podcast.php @@ -21,7 +21,7 @@
<?= $podcast->title ?> -
+

title ?> @name ?>