diff options
| author | horus | 2020-04-21 11:41:58 +0200 |
|---|---|---|
| committer | horus | 2020-04-21 11:41:58 +0200 |
| commit | 8cfba341fff5ea48e8ae6556c4f40a8019bd4fb0 (patch) | |
| tree | 5eed9cd50d9899144f9eb6d7d3aba00ea9997a28 /app | |
| parent | d6505098b79c8b891cc8a1f6a798cc3ff11253bd (diff) | |
| download | senpai-8cfba341fff5ea48e8ae6556c4f40a8019bd4fb0.tar.gz | |
Displays more data.
Diffstat (limited to 'app')
| -rw-r--r-- | app/Http/Controllers/AnimeController.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/app/Http/Controllers/AnimeController.php b/app/Http/Controllers/AnimeController.php index dbc41de..fc7822a 100644 --- a/app/Http/Controllers/AnimeController.php +++ b/app/Http/Controllers/AnimeController.php @@ -41,12 +41,46 @@ class AnimeController extends Controller { $popularity[] = $stats->popularity; $members[] = $stats->members; $favorites[] = $stats->favorites; + $watching[] = $stats->watching; + $completed[] = $stats->completed; + $onhold[] = $stats->onhold; + $dropped[] = $stats->dropped; + $plan_to_watch[] = $stats->plan_to_watch; + + $score_1[] = $stats->score_1; + $score_2[] = $stats->score_2; + $score_3[] = $stats->score_3; + $score_4[] = $stats->score_4; + $score_5[] = $stats->score_5; + $score_6[] = $stats->score_6; + $score_7[] = $stats->score_7; + $score_8[] = $stats->score_8; + $score_9[] = $stats->score_9; + $score_10[] = $stats->score_10; + } $anime["score"] = $score; $anime["rank"] = $rank; $anime["popularity"] = $popularity; $anime["members"] = $members; $anime["favorites"] = $favorites; + $anime["watching"] = $watching; + $anime["onhold"] = $onhold; + $anime["plan_to_watch"] = $plan_to_watch; + $anime["completed"] = $completed; + $anime["dropped"] = $dropped; + + $anime["score_1"] = $score_1; + $anime["score_2"] = $score_2; + $anime["score_3"] = $score_3; + $anime["score_4"] = $score_4; + $anime["score_5"] = $score_5; + $anime["score_6"] = $score_6; + $anime["score_7"] = $score_7; + $anime["score_8"] = $score_8; + $anime["score_9"] = $score_9; + $anime["score_10"] = $score_10; + $anime["chart_label"] = $created_at; $anime["basic_data"] = DB::select('select score, rank, popularity, members, favorites from anime join stats on stats.id = ( select id from stats where anime.mal_id = stats.mal_id order by created_at desc limit 1) where anime.mal_id = ?', [$mal_id])[0]; @@ -61,6 +95,8 @@ class AnimeController extends Controller { #$anime = $anime->setTable('anime'); $anime = $anime->where('is_airing', 1); + $anime = $anime->orderBy('watching', 'desc'); + $anime = $anime->orderBy('members', 'desc'); $anime = $anime->orderBy('score_today', 'desc'); $anime = $anime->simplePaginate(10); |
