wip
This commit is contained in:
1 parent
377478d9e8
commit
8a5b03eec4
3 files changed
+97
-93
No files matched your search
@@ -44,6 +44,7 @@ class StatsMedianAverage extends StatsOverviewWidget
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
$statistic_type = HelperStatisticType::get($this->filters);
|
||||
|
||||
if (! isset($data['datasets'][0])) {
|
||||
@@ -124,46 +125,6 @@ class StatsMedianAverage extends StatsOverviewWidget
|
||||
}
|
||||
|
||||
$boxes = [];
|
||||
// BOX 1
|
||||
$boxes[] = Stat::make('Total', new HtmlString('<div id="number-of-events">' . $total_home . '</div>'))
|
||||
->description('Events')
|
||||
->extraAttributes([
|
||||
'class' => 'box-info',
|
||||
]);
|
||||
// ->extraAttributes(['x-init' => "animate('number-of-events', $total_home, 0)"]);
|
||||
|
||||
// BOX 2
|
||||
$boxes[] = Stat::make('Average ' . $statistic_type, self::template('avhome', 'avaway', $home_team, $away_team, $value_home, $value_away))
|
||||
->description('Team ' . $team_position)
|
||||
->extraAttributes([
|
||||
'class' => 'box-success',
|
||||
]);
|
||||
// ->extraAttributes(['x-init' => "animate('avhome', $value_home); animate('avaway', $value_away)"]);
|
||||
|
||||
// BOX 3
|
||||
// Log::debug([$average_team_home, $average_team_away]);
|
||||
$boxes[] = Stat::make('Average ' . $statistic_type, self::template('av_team_home', 'av_team_away', $home_team, $away_team, $average_team_home, $average_team_away))
|
||||
->description('Team Season')
|
||||
->extraAttributes([
|
||||
'class' => 'box-success',
|
||||
]);
|
||||
// ->extraAttributes(['x-init' => "animate('av_team_home', $average_team_home); animate('av_team_away', $average_team_away)"]);
|
||||
|
||||
// BOX 4
|
||||
$boxes[] = Stat::make('Average ' . $statistic_type, self::template('av_league_home', 'av_league_away', 'Home', 'Away', $average_league_home, $average_league_away))
|
||||
->description('League Season')
|
||||
->extraAttributes([
|
||||
'class' => 'box-success',
|
||||
]);
|
||||
// ->extraAttributes(['x-init' => "animate('av_league_home', $average_league_home); animate('av_league_away', $average_league_away)"]);
|
||||
|
||||
// BOX 5
|
||||
$boxes[] = Stat::make('Odds', self::templateOdds($data, $win, $draw, $lost))
|
||||
->description($team_position)
|
||||
->extraAttributes([
|
||||
'class' => 'box-purple',
|
||||
]);
|
||||
// ->extraAttributes(['x-init' => "animate('mehome', $median_home); animate('meaway', $median_away, 0)"]);
|
||||
|
||||
// BOX 6
|
||||
$boxes[] = Stat::make($statistic_type, self::template('expectations_home', 'expectations_away', 'Home', 'Away', $expectations_home, $expectations_away))
|
||||
@@ -172,6 +133,49 @@ class StatsMedianAverage extends StatsOverviewWidget
|
||||
'class' => 'box-yellow',
|
||||
]);
|
||||
|
||||
if ($team_id) {
|
||||
// BOX 1
|
||||
$boxes[] = Stat::make('Total', new HtmlString('<div id="number-of-events">' . $total_home . '</div>'))
|
||||
->description('Events')
|
||||
->extraAttributes([
|
||||
'class' => 'box-info',
|
||||
]);
|
||||
// ->extraAttributes(['x-init' => "animate('number-of-events', $total_home, 0)"]);
|
||||
|
||||
// BOX 2
|
||||
$boxes[] = Stat::make('Average ' . $statistic_type, self::template('avhome', 'avaway', $home_team, $away_team, $value_home, $value_away))
|
||||
->description('Team ' . $team_position)
|
||||
->extraAttributes([
|
||||
'class' => 'box-success',
|
||||
]);
|
||||
// ->extraAttributes(['x-init' => "animate('avhome', $value_home); animate('avaway', $value_away)"]);
|
||||
|
||||
// BOX 3
|
||||
// Log::debug([$average_team_home, $average_team_away]);
|
||||
$boxes[] = Stat::make('Average ' . $statistic_type, self::template('av_team_home', 'av_team_away', $home_team, $away_team, $average_team_home, $average_team_away))
|
||||
->description('Team Season')
|
||||
->extraAttributes([
|
||||
'class' => 'box-success',
|
||||
]);
|
||||
// ->extraAttributes(['x-init' => "animate('av_team_home', $average_team_home); animate('av_team_away', $average_team_away)"]);
|
||||
|
||||
// BOX 4
|
||||
$boxes[] = Stat::make('Average ' . $statistic_type, self::template('av_league_home', 'av_league_away', 'Home', 'Away', $average_league_home, $average_league_away))
|
||||
->description('League Season')
|
||||
->extraAttributes([
|
||||
'class' => 'box-success',
|
||||
]);
|
||||
// ->extraAttributes(['x-init' => "animate('av_league_home', $average_league_home); animate('av_league_away', $average_league_away)"]);
|
||||
|
||||
// BOX 5
|
||||
$boxes[] = Stat::make('Odds', self::templateOdds($data, $win, $draw, $lost))
|
||||
->description($team_position)
|
||||
->extraAttributes([
|
||||
'class' => 'box-purple',
|
||||
]);
|
||||
// ->extraAttributes(['x-init' => "animate('mehome', $median_home); animate('meaway', $median_away, 0)"]);
|
||||
}
|
||||
|
||||
$this->columns = [
|
||||
'default' => 1,
|
||||
'sm' => 2,
|
||||
|
||||
Reference in new issue
Block a user