wip
This commit is contained in:
1 parent
fc18f98fd8
commit
c329d5a6f5
5 files changed
+33
-38
No files matched your search
@@ -149,10 +149,10 @@ class Statistic extends BaseDashboard
|
||||
->options([
|
||||
'gls' => 'Goals',
|
||||
'crn' => 'Corner',
|
||||
'fls' => 'Fouls commited',
|
||||
'fls' => 'Fouls Commited',
|
||||
'ofs' => 'Offside',
|
||||
'crd' => 'Cards',
|
||||
'snt' => 'Shot on target',
|
||||
'snt' => 'Shots On Target',
|
||||
'tsh' => 'Total shots',
|
||||
]),
|
||||
Select::make('similar_past_matches')
|
||||
@@ -167,6 +167,10 @@ class Statistic extends BaseDashboard
|
||||
->default('none')
|
||||
->live()
|
||||
->selectablePlaceholder(false)
|
||||
->afterStateUpdated(function (callable $set) {
|
||||
$set('team_id', null);
|
||||
$set('tm_player_id', null);
|
||||
})
|
||||
->options([
|
||||
'none' => 'None',
|
||||
'league' => 'League',
|
||||
@@ -233,10 +237,12 @@ class Statistic extends BaseDashboard
|
||||
{
|
||||
return [
|
||||
StatsMedianAverage::make(),
|
||||
// Events
|
||||
ChartPunctualEvent::make(),
|
||||
ChartMovingAverageEvent::make(),
|
||||
ChartPunctualPlayer::make(),
|
||||
ChartMovingAveragePlayer::make(),
|
||||
// Players
|
||||
// ChartPunctualPlayer::make(),
|
||||
// ChartMovingAveragePlayer::make(),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class ChartPunctualPlayer extends ChartWidget
|
||||
|
||||
$this->heading = 'Player';
|
||||
|
||||
$this->description = ucfirst(HelperStatisticType::get($this->filters));
|
||||
$this->description = HelperStatisticType::get($this->filters);
|
||||
|
||||
if (isset($data['description'])) {
|
||||
$this->description .= $data['description'];
|
||||
|
||||
@@ -7,10 +7,10 @@ class HelperStatisticType
|
||||
protected static array $types = [
|
||||
'gls' => 'Goals',
|
||||
'crn' => 'Corner',
|
||||
'fls' => 'Fouls commited',
|
||||
'fls' => 'Fouls Commited',
|
||||
'ofs' => 'Offside',
|
||||
'crd' => 'Cards',
|
||||
'snt' => 'Shot on target',
|
||||
'snt' => 'Shots On Target',
|
||||
'tsh' => 'Total shots',
|
||||
];
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class LoadEvents
|
||||
if (! $match_id) {
|
||||
return [];
|
||||
}
|
||||
if (! $team_id && $similar_past_matches != 'none') {
|
||||
if (! $team_id && $similar_past_matches == 'none') {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ class LoadEvents
|
||||
*/
|
||||
$handicap_range = 0;
|
||||
$total_range = 0;
|
||||
if ($similar_past_matches != 'none' && isset($res)) {
|
||||
if ($similar_past_matches != 'none') {
|
||||
$res = StatisticFixtures::where('id', (int) $match_id)->first();
|
||||
|
||||
$exp_handicap = $res->exp_away - $res->exp_home;
|
||||
@@ -103,8 +103,7 @@ class LoadEvents
|
||||
/**
|
||||
* STATTISTIC DATA
|
||||
*/
|
||||
$res = StatistikoEvent::with('home')
|
||||
->with('away')
|
||||
$res = StatistikoEvent::with('home')->with('away')
|
||||
->where(function ($query) use ($league_id, $similar_past_matches) {
|
||||
switch ($similar_past_matches) {
|
||||
case 'none':
|
||||
@@ -148,18 +147,8 @@ class LoadEvents
|
||||
$labels = [];
|
||||
$events = [];
|
||||
$labels_since = [];
|
||||
// win in favor (w) against (w2)
|
||||
// draw in favor (d) against (d2)
|
||||
// lost in favor (l) against (l2)
|
||||
$results = ['w' => 0, 'd' => 0, 'l' => 0, 'w2' => 0, 'l2' => 0];
|
||||
|
||||
/**
|
||||
* IF WITH PLAYER
|
||||
*/
|
||||
// $res = StatisticFixtures::with('home')->with('away')->where('id', (int) $match_id)->first();
|
||||
// $event = $res->home->name.' vs '.$res->away->name;
|
||||
// dd($event);
|
||||
|
||||
foreach ($res as $value) {
|
||||
|
||||
$labels[] = $value['starttime']->format('d.M.Y H:i');
|
||||
|
||||
Reference in new issue
Block a user