This commit is contained in:
salam committed 2026-01-08 19:57:49 +01:00
1 parent 4f9125ef12
commit 61418c8cee
47 files changed
+726 -221

No files matched your search

@@ -0,0 +1,25 @@
<?php
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Nuh;
use App\Models\Odds2way;
use App\Utilities\Margin;
class _2Way
{
public static function grap($odds, $offer)
{
foreach ($offer as $value) {
$odds['h2w'] = (float) $value->o1;
$odds['a2w'] = (float) $value->o3;
$odds['starttime'] = (string) $value['starttime'];
}
$odds['margin'] = (float) Margin::calculate([$odds['h2w'], $odds['a2w']], 1);
Odds2way::updateOrCreate([
'event_id' => Nuh::$id,
'bookmaker_id' => Nuh::$bookmaker_id,
], $odds);
}
}