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];
|
$total_range = [$exp_total - $accuracy, $exp_total + $accuracy];
|
||||||
|
|
||||||
$home_team = $match->home->name;
|
$home_team = $match->home->ss_team_name;
|
||||||
$away_team = $match->away->name;
|
$away_team = $match->away->ss_team_name;
|
||||||
} else {
|
} else {
|
||||||
$home_team = 'In Favour';
|
$home_team = 'In Favour';
|
||||||
$away_team = 'Against';
|
$away_team = 'Against';
|
||||||
|
|||||||
@@ -3,13 +3,14 @@
|
|||||||
namespace App\Filament\Widgets\Data\LoadEvents;
|
namespace App\Filament\Widgets\Data\LoadEvents;
|
||||||
|
|
||||||
use App\Models\CompetitionGroup;
|
use App\Models\CompetitionGroup;
|
||||||
|
use App\Models\SofaScoreTournament;
|
||||||
use App\Models\StatistikoEvent;
|
use App\Models\StatistikoEvent;
|
||||||
|
|
||||||
class LoadEventsAverages
|
class LoadEventsAverages
|
||||||
{
|
{
|
||||||
public static function load(array &$data, array $filter, array $labels, array $events)
|
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'];
|
$team_position = $filter['team_position'];
|
||||||
|
|
||||||
@@ -18,15 +19,16 @@ class LoadEventsAverages
|
|||||||
$statistic_type = $filter['statistic_type'] ?? 'gls';
|
$statistic_type = $filter['statistic_type'] ?? 'gls';
|
||||||
|
|
||||||
|
|
||||||
$res = CompetitionGroup::with('country')->where('id', $league_id)->first();
|
$res = SofaScoreTournament::with('sofascore_category')->where('tournament_id', $tournament_id)->first();
|
||||||
$season_mode = $res->country->season_mode;
|
|
||||||
|
$season_mode = $res->sofascore_category->country->season_mode;
|
||||||
if ($season_mode == 'fullyear') {
|
if ($season_mode == 'fullyear') {
|
||||||
$season = date('Y');
|
$season = date('Y');
|
||||||
} else {
|
} else {
|
||||||
$season = date('y') - 1 . '/' . date('Y');
|
$season = date('y') - 1 . '/' . date('Y');
|
||||||
}
|
}
|
||||||
|
|
||||||
$res = StatistikoEvent::where('league_id', $league_id)
|
$res = StatistikoEvent::where('league_id', $tournament_id)
|
||||||
->where('season', $season)
|
->where('season', $season)
|
||||||
->orderBy('starttime', 'ASC')
|
->orderBy('starttime', 'ASC')
|
||||||
->get();
|
->get();
|
||||||
|
|||||||
Reference in new issue
Block a user