Loading app/Models/EpisodeModel.php +10 −12 Original line number Diff line number Diff line Loading @@ -324,10 +324,8 @@ class EpisodeModel extends UuidModel { $result = $this->builder() ->selectMax('season_number', 'current_season_number') ->where([ 'podcast_id' => $podcastId, 'published_at IS NOT' => null, ]) ->where('podcast_id', $podcastId) ->where('`published_at` <= UTC_TIMESTAMP()', null, false) ->get() ->getResultArray(); Loading @@ -341,8 +339,9 @@ class EpisodeModel extends UuidModel ->where([ 'podcast_id' => $podcastId, 'season_number' => $seasonNumber, 'published_at IS NOT' => null, ])->get() ]) ->where('`published_at` <= UTC_TIMESTAMP()', null, false) ->get() ->getResultArray(); return (int) $result[0]['next_episode_number'] + 1; Loading @@ -357,10 +356,9 @@ class EpisodeModel extends UuidModel ->select( 'COUNT(DISTINCT season_number) as number_of_seasons, COUNT(*) as number_of_episodes, MIN(published_at) as first_published_at' ) ->where([ 'podcast_id' => $podcastId, 'published_at IS NOT' => null, ])->get() ->where('podcast_id', $podcastId) ->where('`published_at` <= UTC_TIMESTAMP()', null, false) ->get() ->getResultArray(); $stats = [ Loading app/Models/PodcastModel.php +2 −4 Original line number Diff line number Diff line Loading @@ -247,7 +247,6 @@ class PodcastModel extends Model ->where([ 'podcast_id' => $podcastId, 'season_number' => null, 'published_at IS NOT' => null, ]) ->where('`published_at` <= UTC_TIMESTAMP()', null, false) ->groupBy('year') Loading Loading @@ -284,7 +283,6 @@ class PodcastModel extends Model ->where([ 'podcast_id' => $podcastId, 'season_number is not' => null, 'published_at IS NOT' => null, ]) ->where('`published_at` <= UTC_TIMESTAMP()', null, false) ->groupBy('season_number') Loading Loading
app/Models/EpisodeModel.php +10 −12 Original line number Diff line number Diff line Loading @@ -324,10 +324,8 @@ class EpisodeModel extends UuidModel { $result = $this->builder() ->selectMax('season_number', 'current_season_number') ->where([ 'podcast_id' => $podcastId, 'published_at IS NOT' => null, ]) ->where('podcast_id', $podcastId) ->where('`published_at` <= UTC_TIMESTAMP()', null, false) ->get() ->getResultArray(); Loading @@ -341,8 +339,9 @@ class EpisodeModel extends UuidModel ->where([ 'podcast_id' => $podcastId, 'season_number' => $seasonNumber, 'published_at IS NOT' => null, ])->get() ]) ->where('`published_at` <= UTC_TIMESTAMP()', null, false) ->get() ->getResultArray(); return (int) $result[0]['next_episode_number'] + 1; Loading @@ -357,10 +356,9 @@ class EpisodeModel extends UuidModel ->select( 'COUNT(DISTINCT season_number) as number_of_seasons, COUNT(*) as number_of_episodes, MIN(published_at) as first_published_at' ) ->where([ 'podcast_id' => $podcastId, 'published_at IS NOT' => null, ])->get() ->where('podcast_id', $podcastId) ->where('`published_at` <= UTC_TIMESTAMP()', null, false) ->get() ->getResultArray(); $stats = [ Loading
app/Models/PodcastModel.php +2 −4 Original line number Diff line number Diff line Loading @@ -247,7 +247,6 @@ class PodcastModel extends Model ->where([ 'podcast_id' => $podcastId, 'season_number' => null, 'published_at IS NOT' => null, ]) ->where('`published_at` <= UTC_TIMESTAMP()', null, false) ->groupBy('year') Loading Loading @@ -284,7 +283,6 @@ class PodcastModel extends Model ->where([ 'podcast_id' => $podcastId, 'season_number is not' => null, 'published_at IS NOT' => null, ]) ->where('`published_at` <= UTC_TIMESTAMP()', null, false) ->groupBy('season_number') Loading