wip bug 7
This commit is contained in:
1 parent
b656d5d993
commit
e6129fbdf6
3 files changed
+6
-11
No files matched your search
@@ -16,15 +16,15 @@ class HelperMoveingAveragePerformens
|
||||
foreach ($datasets as $k => $dataset) {
|
||||
$arr = $dataset['data'];
|
||||
|
||||
self::fillHoles($arr);
|
||||
// dd($arr);
|
||||
|
||||
$new = [];
|
||||
$last = count($arr);
|
||||
foreach ($arr as $key => $value) {
|
||||
if ($key == 1 && $last > 2) {
|
||||
$new[] = round(($arr[0] + $value + $arr[2]) / 3, 1);
|
||||
$new[] = round(($arr[0] + $value + $arr[2]) / 3, 2);
|
||||
} elseif ($key > 1 && $key < $last - 1) {
|
||||
$new[] = round(($arr[$key - 1] + $value + $arr[$key + 1]) / 3, 1);
|
||||
$new[] = round(($arr[$key - 1] + $value + $arr[$key + 1]) / 3, 2);
|
||||
}
|
||||
}
|
||||
$data['datasets'][$k]['data'] = $new;
|
||||
|
||||
@@ -31,6 +31,7 @@ class LoadPerformance
|
||||
}
|
||||
|
||||
$match = StatisticFixtures::with('home')->with('away')->where('id', $match_id)->first();
|
||||
|
||||
$home_id = $match->home_id;
|
||||
$away_id = $match->away_id;
|
||||
|
||||
@@ -55,19 +56,13 @@ class LoadPerformance
|
||||
|
||||
if ($val->home_id == $home_id or $val->away_id == $home_id) {
|
||||
$home_matches[] = $val->match_id;
|
||||
} else {
|
||||
$home_matches[] = null;
|
||||
}
|
||||
if ($val->home_id == $away_id or $val->away_id == $away_id) {
|
||||
$away_matches[] = $val->match_id;
|
||||
} else {
|
||||
$away_matches[] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// dd($away_matches);
|
||||
|
||||
$res = StatistikoPlayer::whereIn('match_id', $home_matches)->select('match_id', 'minutes_played', 'playerrating_value', 'player_position')->get();
|
||||
$homes = self::filterMatches($res, $home_matches);
|
||||
|
||||
|
||||
Reference in new issue
Block a user