summaryrefslogtreecommitdiff
path: root/app/Http/Controllers/AnimeController.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Http/Controllers/AnimeController.php')
-rw-r--r--app/Http/Controllers/AnimeController.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/app/Http/Controllers/AnimeController.php b/app/Http/Controllers/AnimeController.php
index 83d36c8..1da62e1 100644
--- a/app/Http/Controllers/AnimeController.php
+++ b/app/Http/Controllers/AnimeController.php
@@ -180,13 +180,18 @@ class AnimeController extends Controller {
return view('list_anime', ["all_anime" => $sanime, "title" => "Search", "count" => $count]);
}
- public function showSeason($season_name, $season_year) {
- $season_name = ucfirst($season_name);
+ public function showSeason($season_year, $season_name = null) {
$anime = new Anime;
$anime = $anime->setTable('view_anime_index');
- $anime = $anime->where('season_name', '=', $season_name)->where('season_year', '=', $season_year);
+ $anime = $anime->where('season_year', '=', $season_year);
+
+ if ( ! is_null($season_name) ) {
+ $season_name = ucfirst($season_name);
+ $anime = $anime->where('season_name', '=', $season_name);
+ }
+
$anime = $anime->orderBy('score_today', 'desc');
$anime = $anime->orderBy('members', 'desc');
$anime = $anime->orderBy('watching', 'desc');