Files
nuhodds_fi4/app/Console/Commands/Grapper/Logifuture/Icehockey.php
T
2026-01-18 14:35:30 +01:00

79 lines
2.4 KiB
PHP

<?php
namespace App\Console\Commands\Grapper\Logifuture;
use App\Console\Commands\Grapper\Logifuture\Tools\PrinzipalHandicap;
class Icehockey
{
public static function get(&$event, &$_spreads, $match)
{
$n_totals = [];
$n_points = [];
$c_totals = [];
$c_points = [];
foreach ($match['odds'] as $name => $value) {
switch ($name) {
case 'IH_1X2_1':
$event['h3w'] = number_format($value, 2);
break;
case 'IH_1X2_X':
$event['d3w'] = number_format($value, 2);
break;
case 'IH_1X2_2':
$event['a3w'] = number_format($value, 2);
break;
case 'IH_12_1':
case 'IH_12OTAP_1':
$event['h2w'] = number_format($value, 2);
break;
case 'IH_12_2':
case 'IH_12OTAP_2':
$event['a2w'] = number_format($value, 2);
break;
}
if (strpos($name, '@') !== false) {
$pos = strpos($name, '@');
$market = substr($name, 0, $pos);
switch ($market) {
// NIGERIA
case 'IH_TF':
$n_totals[$name] = $value;
break;
case 'IH_HR1':
$n_points[$name] = $value;
break;
// COLOMBIA
case 'IH_OUHND':
$c_totals[$name] = $value;
break;
case 'IH_12HND':
$c_points[$name] = $value;
break;
}
}
}
// COLUMBIA
if ($c_totals) {
PrinzipalHandicap::filter($_spreads['total'], 'IH_OUHND@', $c_totals, ['over', 'under', 'total']);
}
if ($c_points) {
PrinzipalHandicap::filter($_spreads['point'], 'IH_12HND@', $c_points, ['hth1', 'hth2', 'hcap']);
}
// NIGERIA
if ($n_totals) {
PrinzipalHandicap::filter($_spreads['total'], 'IH_TF@', $n_totals, ['over', 'under', 'total']);
}
if ($n_points) {
PrinzipalHandicap::filter($_spreads['point'], 'IH_HR1@', $n_points, ['hth1', 'hth2', 'hcap']);
}
}
}