wip del err

This commit is contained in:
salam committed 2026-10-04 15:22:39 +02:00
1 parent 812736ca9a
commit 9bcd4432c6
1210 files changed
-220941

No files matched your search

@@ -1,40 +0,0 @@
<?php
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Nuh;
use App\Models\OddsDc;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
class Odds_Dc
{
public static function grap($odds, $offer)
{
$block_update = Nuh::$options['b'] ?? 0;
foreach ($offer as $value) {
$odds['dc1x'] = (float) $value->o1;
$odds['dc12'] = (float) $value->o2;
$odds['dcx2'] = (float) $value->o3;
}
$odds['margin'] = (float) Margin::calculate([$odds['dc1x'], $odds['dc12'], $odds['dcx2']], 1);
$res = OddsDc::where('event_id', $odds['event_id'])->where('bookmaker_id', $odds['bookmaker_id'])->first();
if (! $res) {
OddsDc::create($odds);
} elseif (! $block_update) {
$res->dc1x = $odds['dc1x'];
$res->dc12 = $odds['dc12'];
$res->dcx2 = $odds['dcx2'];
$res->flags = 1;
$res->margin = $odds['margin'];
DB::transaction(function () use ($res) {
$res->save();
}, 5);
}
}
}