24 lines
527 B
PHP
24 lines
527 B
PHP
<?php
|
|
|
|
namespace App\Actions;
|
|
|
|
use App\Models\StatisticFixtures;
|
|
|
|
class LoadStatisticFixturesMatchOptions
|
|
{
|
|
public static function load($league_id = 0)
|
|
{
|
|
if (! $league_id) {
|
|
return [];
|
|
}
|
|
$res = StatisticFixtures::where('league_id', $league_id)->get();
|
|
|
|
$arr = [];
|
|
foreach ($res as $val) {
|
|
$arr[$val->id] = $val->starttime->format('Y-m-d H:i') . ' - ' . $val->home->ss_team_name . ' vs ' . $val->away->ss_team_name;
|
|
}
|
|
|
|
return $arr;
|
|
}
|
|
}
|