wip generate positions in PP
This commit is contained in:
1 parent
01b62be635
commit
8ae58d2e2a
7 files changed
+261
-60
No files matched your search
@@ -6,7 +6,7 @@ use App\Models\StatistikoEvent;
|
||||
|
||||
class ExpectationsMinMax
|
||||
{
|
||||
public static function calc(array &$expectations, int $league_id)
|
||||
public static function calc(array &$expectations, object $match)
|
||||
{
|
||||
/**
|
||||
* get min and max for each bettype from all DB for liga
|
||||
@@ -15,7 +15,7 @@ class ExpectationsMinMax
|
||||
$bets = ['crn', 'fls', 'ofs', 'crd', 'snt', 'tsh'];
|
||||
$Y = 0.25;
|
||||
|
||||
$res = StatistikoEvent::where('league_id', $league_id)->get();
|
||||
$res = StatistikoEvent::where('league_id', $match->league_id)->get();
|
||||
$count = $res->count();
|
||||
|
||||
$data = [];
|
||||
@@ -75,5 +75,24 @@ class ExpectationsMinMax
|
||||
$expectations[$key]['away'] = $final[$key]['min'];
|
||||
}
|
||||
}
|
||||
|
||||
// GOALS with asp from fixtures
|
||||
$gls_home_max = $match->exp_home * (1 + ($Y / 2));
|
||||
$gls_home_min = $match->exp_home * (1 - ($Y / 2));
|
||||
$gls_away_max = $match->exp_away * (1 + ($Y / 2));
|
||||
$gls_away_min = $match->exp_away * (1 - ($Y / 2));
|
||||
|
||||
if ($expectations['gls']['home'] > $gls_home_max) {
|
||||
$expectations['gls']['home'] = $gls_home_max;
|
||||
}
|
||||
if ($expectations['gls']['away'] > $gls_away_max) {
|
||||
$expectations['gls']['away'] = $gls_away_max;
|
||||
}
|
||||
if ($expectations['gls']['home'] < $gls_home_min) {
|
||||
$expectations['gls']['home'] = $gls_home_min;
|
||||
}
|
||||
if ($expectations['gls']['away'] < $gls_away_min) {
|
||||
$expectations['gls']['away'] = $gls_away_min;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user