statistic filter player grafics wip
This commit is contained in:
1 parent
4de73f9275
commit
3bc956e0b9
5 files changed
+93
-29
No files matched your search
@@ -18,23 +18,25 @@ class LoadPlayer
|
||||
|
||||
$league_id = (int) $filter['league_id'] ?? 0;
|
||||
|
||||
$match_id = (int) $filter['match_id'] ?? 0;
|
||||
|
||||
$team_id = (int) $filter['team_id'] ?? 0;
|
||||
|
||||
$tm_player_id = (int) $filter['tm_player_id'] ?? 0;
|
||||
|
||||
$start = $filter['start_date'] ?? 0;
|
||||
|
||||
$end = $filter['end_date'] ?? 0;
|
||||
|
||||
$statistic_type = $filter['statistic_type'];
|
||||
|
||||
$team_position = $filter['team_position'];
|
||||
|
||||
$player_on_field = $filter['player_on_field'];
|
||||
|
||||
$statistic_type = $filter['statistic_type'] ?? 0;
|
||||
|
||||
$accuracy = (float) $filter['accuracy'];
|
||||
|
||||
$similar_past_matches = $filter['similar_past_matches'] ?? 0;
|
||||
|
||||
$start = $filter['start_date'] ?? 0;
|
||||
|
||||
$end = $filter['end_date'] ?? 0;
|
||||
$similar_past_matches = $filter['similar_past_matches'];
|
||||
|
||||
if (! $league_id) {
|
||||
return [];
|
||||
@@ -46,6 +48,31 @@ class LoadPlayer
|
||||
return [];
|
||||
}
|
||||
|
||||
if ($statistic_type == 'none') {
|
||||
$statistic_type = 'gls';
|
||||
}
|
||||
|
||||
/**
|
||||
* IF WITH SIMILAR_PAST_MATCHES
|
||||
*
|
||||
* 'none' => 'None',
|
||||
* 'league' => 'League',
|
||||
* 'all' => 'All Database',
|
||||
*/
|
||||
// $handicap_range = 0;
|
||||
// $total_range = 0;
|
||||
// if ($similar_past_matches != 'none') {
|
||||
// $res = StatisticFixtures::where('id', (int) $match_id)->first();
|
||||
|
||||
// $exp_handicap = $res->exp_away - $res->exp_home;
|
||||
|
||||
// $exp_total = $res->exp_away + $res->exp_home;
|
||||
|
||||
// $handicap_range = [$exp_handicap - $accuracy, $exp_handicap + $accuracy];
|
||||
|
||||
// $total_range = [$exp_total - $accuracy, $exp_total + $accuracy];
|
||||
// }
|
||||
|
||||
/**
|
||||
* STATTISTIC DATA
|
||||
*/
|
||||
@@ -60,9 +87,9 @@ class LoadPlayer
|
||||
return $query->where('home_id', '=', $team_id)
|
||||
->orWhere('away_id', '=', $team_id);
|
||||
}
|
||||
})
|
||||
->when($matches_played, function ($query) use ($matches_played) {
|
||||
return $query->whereIn('match_id', $matches_played);
|
||||
// })
|
||||
// ->when($matches_played, function ($query) use ($matches_played) {
|
||||
// return $query->whereIn('match_id', $matches_played);
|
||||
})->when($start, function ($query) use ($start) {
|
||||
return $query->where('starttime', '>=', $start);
|
||||
})->when($end, function ($query) use ($end) {
|
||||
|
||||
Reference in new issue
Block a user