This commit is contained in:
salam committed 2026-08-29 20:12:15 +02:00
1 parent f6f898c207
commit 68607108b4
6 files changed
+27 -32

No files matched your search

@@ -3,19 +3,20 @@
namespace App\Filament\Pages\Selections\Helper;
use App\Models\SofaScoreCategory;
use Filament\Schemas\Components\Utilities\Get;
class GetSeason
{
public static function load(array $season, int $sofascore_category_id)
public static function load(array $season, int|null $sofascore_category_id)
{
if (!$season) {
$season_mode = SofaScoreCategory::where('id', $sofascore_category_id)->value('season_mode');
if ($season_mode == 'halfyear') {
if ((int) date('m') > 7)
$season[] = date('y') . '/' . date('y', strtotime('+1 year'));
else
$season[] = date('y', strtotime('-1 year')) . '/' . date('y');
if ($sofascore_category_id) {
$season_mode = SofaScoreCategory::where('id', $sofascore_category_id)->value('season_mode');
if ($season_mode == 'halfyear') {
if ((int) date('m') > 7)
$season[] = date('y') . '/' . date('y', strtotime('+1 year'));
else
$season[] = date('y', strtotime('-1 year')) . '/' . date('y');
}
}
}
@@ -11,9 +11,7 @@ class LoadSeasons
// $res = CompetitionGroup::with('country')->where('id', $league_id)->first();
// $season_mode = $res->country->season_mode;
$res = StatistikoEvent::where('league_id', $league_id)
->groupBy('season')
->get();
$res = StatistikoEvent::select('season')->where('league_id', $league_id)->get();
if (! $res) {
return [];
@@ -24,7 +22,7 @@ class LoadSeasons
$arr[$val->season] = $val->season;
}
sort($arr);
asort($arr);
return $arr;
}