Files
nuhodds_fi4/app/Console/Commands/Grapper/TxOdds/Odds/_3WayHt.php
T
2026-01-18 10:40:19 +01:00

29 lines
710 B
PHP

<?php
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
class _3WayHt
{
public static function grap($odds, $offer)
{
foreach ($offer as $value) {
$odds['h3w'] = (float) $value->o1;
$odds['d3w'] = (float) $value->o2;
$odds['a3w'] = (float) $value->o3;
}
$odds['margin'] = (float) Margin::calculate([$odds['h3w'], $odds['d3w'], $odds['a3w']], 1);
$odds['updated_at'] = now();
DB::table('odds_3ways_ht')->upsert(
$odds,
['event_id', 'bookmaker_id'],
['h3w', 'd3w', 'a3w', 'margin', 'flags', 'updated_at']
);
}
}