LoadEvents with description
This commit is contained in:
1 parent
4f63a4ef2c
commit
1f4fb9cf8a
6 files changed
+48
-144
No files matched your search
@@ -16,25 +16,6 @@ class LoadPlayer
|
||||
return self::$last_query;
|
||||
}
|
||||
|
||||
// "team_position" => "all"
|
||||
// "statistic_type" => "gls"
|
||||
// "similar_past_matches" => "none"
|
||||
// "accuracy" => "0.5"
|
||||
// "player_on_field" => "all"
|
||||
// "league_id" => "26"
|
||||
// "team_id" => "571991"
|
||||
// "start_date" => null
|
||||
// "end_date" => null
|
||||
// "tm_player_id" => null
|
||||
|
||||
// 'gls' => 'Goals', // goals
|
||||
// 'crn' => 'Corner',
|
||||
// 'fls' => 'Fouls commited', // fouls
|
||||
// 'ofs' => 'Offside', // offsides
|
||||
// 'crd' => 'Cards',
|
||||
// 'snt' => 'Shot on target', // shots_on_target
|
||||
// 'tsh' => 'Total shots', // shots_off_target
|
||||
|
||||
$league_id = (int) $filter['league_id'] ?? 0;
|
||||
|
||||
$team_id = (int) $filter['team_id'] ?? 0;
|
||||
@@ -47,6 +28,8 @@ class LoadPlayer
|
||||
|
||||
$statistic_type = $filter['statistic_type'] ?? 0;
|
||||
|
||||
$accuracy = (float) $filter['accuracy'];
|
||||
|
||||
$similar_past_matches = $filter['similar_past_matches'] ?? 0;
|
||||
|
||||
$start = $filter['start_date'] ?? 0;
|
||||
@@ -86,6 +69,23 @@ class LoadPlayer
|
||||
return $query->where('starttime', '<=', $end);
|
||||
})->first();
|
||||
|
||||
if ($res == null) {
|
||||
|
||||
$handicap_range = 0;
|
||||
|
||||
$total_range = 0;
|
||||
|
||||
} else {
|
||||
|
||||
$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];
|
||||
}
|
||||
|
||||
$labels = [];
|
||||
$datasets = [];
|
||||
foreach ($res as $key => $value) {
|
||||
|
||||
Reference in new issue
Block a user