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