fumetto max ok

This commit is contained in:
salam committed 2026-01-03 17:46:23 +01:00
1 parent 9e7384daf8
commit 9c78f507f4
58 files changed
+672 -144

No files matched your search

@@ -0,0 +1,48 @@
<?php
namespace App\Console\Commands\Grapper\Magloo\Odds;
use App\Utilities\Margin;
class FilterHandicap
{
public static function get($_array)
{
$_points = [];
foreach ($_array as $handicap => $value) {
if (fmod(abs($handicap), 1) == 0.5) {
if ($value[1714] > 1 and $value[1715] > 1) {
$_points[$handicap]['home'] = $value[1714];
$_points[$handicap]['away'] = $value[1715];
}
}
}
$tmp = 10000;
$handicap = false;
foreach ($_points as $key => $value) {
$x = 0;
foreach ($value as $k => $v) {
if ($x == 0) {
$x = $v;
} else {
$x -= $v;
}
}
$x = abs($x);
if ($x < $tmp) {
$handicap = $key;
$tmp = $x;
}
}
$return = [];
if ($handicap) {
$return['home'] = $_points[$handicap]['home'];
$return['away'] = $_points[$handicap]['away'];
$return['margin'] = (float) Margin::calculate($return, 1);
$return['handicap'] = $handicap;
}
return $return;
}
}
@@ -0,0 +1,50 @@
<?php
namespace App\Console\Commands\Grapper\Magloo\Odds;
use App\Utilities\Margin;
class FilterHandicapQ1
{
public static function get($_array)
{
$_points = [];
foreach ($_array as $handicap => $value) {
$t = explode('_', $handicap);
$handicap = $t[1];
if (fmod(abs($handicap), 1) == 0.5) {
if ($value[1714] > 1 and $value[1715] > 1) {
$_points[$handicap]['home'] = $value[1714];
$_points[$handicap]['away'] = $value[1715];
}
}
}
$tmp = 10000;
$handicap = false;
foreach ($_points as $key => $value) {
$x = 0;
foreach ($value as $k => $v) {
if ($x == 0) {
$x = $v;
} else {
$x -= $v;
}
}
$x = abs($x);
if ($x < $tmp) {
$handicap = $key;
$tmp = $x;
}
}
$return = [];
if ($handicap) {
$return['home'] = $_points[$handicap]['home'];
$return['away'] = $_points[$handicap]['away'];
$return['margin'] = (float) Margin::calculate($return, 1);
$return['handicap'] = $handicap;
}
return $return;
}
}
@@ -0,0 +1,51 @@
<?php
namespace App\Console\Commands\Grapper\Magloo\Odds;
use App\Utilities\Margin;
class FilterTotals
{
public static function get($_array, $sport_id)
{
$_totals = [];
foreach ($_array as $total => $value) {
if (fmod(abs($total), 1) == 0.5) {
if ($value[12] > 1 and $value[13] > 1) {
$_totals[$total]['over'] = $value[12];
$_totals[$total]['under'] = $value[13];
}
}
}
if ($sport_id == 1) {
$spread = '2.5';
} else {
$tmp = 10000;
$spread = false;
foreach ($_totals as $key => $value) {
$x = 0;
foreach ($value as $v) {
if ($x == 0) {
$x = $v;
} else {
$x -= $v;
}
}
$x = abs($x);
if ($x < $tmp) {
$spread = $key;
$tmp = $x;
}
}
}
$return = [];
if (isset($_totals[$spread])) {
$return['over'] = $_totals[$spread]['over'];
$return['under'] = $_totals[$spread]['under'];
$return['margin'] = (float) Margin::calculate($return, 1);
$return['total'] = $spread;
}
return $return;
}
}
@@ -0,0 +1,53 @@
<?php
namespace App\Console\Commands\Grapper\Magloo\Odds;
use App\Utilities\Margin;
class FilterTotalsQ1
{
public static function get($_array, $sport_id)
{
$_totals = [];
foreach ($_array as $total => $value) {
if (fmod(abs($total), 1) == 0.5) {
$t = explode('_', $total);
$total = $t[1];
if ($value[12] > 1 and $value[13] > 1) {
$_totals[$total]['over'] = $value[12];
$_totals[$total]['under'] = $value[13];
}
}
}
if ($sport_id == 1) {
$spread = '2.5';
} else {
$tmp = 10000;
$spread = false;
foreach ($_totals as $key => $value) {
$x = 0;
foreach ($value as $k => $v) {
if ($x == 0) {
$x = $v;
} else {
$x -= $v;
}
}
$x = abs($x);
if ($x < $tmp) {
$spread = $key;
$tmp = $x;
}
}
}
$return = [];
if (isset($_totals[$spread])) {
$return['over'] = $_totals[$spread]['over'];
$return['under'] = $_totals[$spread]['under'];
$return['margin'] = (float) Margin::calculate($return, 1);
$return['total'] = $spread;
}
return $return;
}
}