wip average all bettype in boxes
This commit is contained in:
1 parent
1a46e5d887
commit
fe4fa6e9cf
16 files changed
+1010
-135
No files matched your search
@@ -6,18 +6,19 @@ use Illuminate\Support\Carbon;
|
||||
|
||||
class GetSeason
|
||||
{
|
||||
public static function load(array|null $season, string|null $seasonmode)
|
||||
public static function load(?array $season, ?string $seasonmode)
|
||||
{
|
||||
if (!\is_array($season) || !\count($season)) {
|
||||
if (! \is_array($season) || ! \count($season)) {
|
||||
|
||||
$date = Carbon::now();
|
||||
|
||||
$season = [];
|
||||
if ($seasonmode == 'halfyear') {
|
||||
if ((int) date('m') > 7)
|
||||
$season[] = (string) $date->format('y') . '/' . $date->format('y') + 1;
|
||||
else
|
||||
$season[] = (string) $date->format('y') - 1 . '/' . $date->format('y');
|
||||
if ((int) date('m') > 7) {
|
||||
$season[] = (string) $date->format('y').'/'.$date->format('y') + 1;
|
||||
} else {
|
||||
$season[] = (string) $date->format('y') - 1 .'/'.$date->format('y');
|
||||
}
|
||||
} else {
|
||||
$season[] = (string) $date->year;
|
||||
}
|
||||
@@ -25,4 +26,23 @@ class GetSeason
|
||||
|
||||
return $season;
|
||||
}
|
||||
|
||||
public static function active(?string $seasonmode)
|
||||
{
|
||||
|
||||
$date = Carbon::now();
|
||||
|
||||
$active_season = '';
|
||||
if ($seasonmode == 'halfyear') {
|
||||
if ((int) date('m') > 7) {
|
||||
$active_season = (string) $date->format('y').'/'.$date->format('y') + 1;
|
||||
} else {
|
||||
$active_season = (string) $date->format('y') - 1 .'/'.$date->format('y');
|
||||
}
|
||||
} else {
|
||||
$active_season = (string) $date->year;
|
||||
}
|
||||
|
||||
return $active_season;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user