wip
This commit is contained in:
1 parent
df0a2a9de0
commit
a381a3c8c8
2 files changed
+8
-6
No files matched your search
@@ -84,8 +84,8 @@ class LoadEvents
|
||||
|
||||
$total_range = [$exp_total - $accuracy, $exp_total + $accuracy];
|
||||
|
||||
$home_team = $match->home->name;
|
||||
$away_team = $match->away->name;
|
||||
$home_team = $match->home->ss_team_name;
|
||||
$away_team = $match->away->ss_team_name;
|
||||
} else {
|
||||
$home_team = 'In Favour';
|
||||
$away_team = 'Against';
|
||||
|
||||
@@ -3,13 +3,14 @@
|
||||
namespace App\Filament\Widgets\Data\LoadEvents;
|
||||
|
||||
use App\Models\CompetitionGroup;
|
||||
use App\Models\SofaScoreTournament;
|
||||
use App\Models\StatistikoEvent;
|
||||
|
||||
class LoadEventsAverages
|
||||
{
|
||||
public static function load(array &$data, array $filter, array $labels, array $events)
|
||||
{
|
||||
$league_id = (int) $filter['league_id'] ?? 0;
|
||||
$tournament_id = (int) $filter['league_id'] ?? 0;
|
||||
|
||||
$team_position = $filter['team_position'];
|
||||
|
||||
@@ -18,15 +19,16 @@ class LoadEventsAverages
|
||||
$statistic_type = $filter['statistic_type'] ?? 'gls';
|
||||
|
||||
|
||||
$res = CompetitionGroup::with('country')->where('id', $league_id)->first();
|
||||
$season_mode = $res->country->season_mode;
|
||||
$res = SofaScoreTournament::with('sofascore_category')->where('tournament_id', $tournament_id)->first();
|
||||
|
||||
$season_mode = $res->sofascore_category->country->season_mode;
|
||||
if ($season_mode == 'fullyear') {
|
||||
$season = date('Y');
|
||||
} else {
|
||||
$season = date('y') - 1 . '/' . date('Y');
|
||||
}
|
||||
|
||||
$res = StatistikoEvent::where('league_id', $league_id)
|
||||
$res = StatistikoEvent::where('league_id', $tournament_id)
|
||||
->where('season', $season)
|
||||
->orderBy('starttime', 'ASC')
|
||||
->get();
|
||||
|
||||
Reference in new issue
Block a user