wip
This commit is contained in:
1 parent
5779c071a5
commit
5cf6ec20dc
3 files changed
+30
-5
No files matched your search
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions\Selections;
|
||||
|
||||
use App\Models\StatistikoEvent;
|
||||
|
||||
class LoadSeasons
|
||||
{
|
||||
public static function load($league_id)
|
||||
{
|
||||
// $res = CompetitionGroup::with('country')->where('id', $league_id)->first();
|
||||
// $season_mode = $res->country->season_mode;
|
||||
|
||||
$res = StatistikoEvent::where('league_id', $league_id)
|
||||
->groupBy('season')
|
||||
->orderBy('starttime', 'ASC')
|
||||
->get();
|
||||
|
||||
if (! $res) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$arr = [];
|
||||
foreach ($res as $val) {
|
||||
$arr[$val->season] = $val->season;
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user