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

28 lines
630 B
PHP

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