This commit is contained in:
salam committed 2026-02-16 11:00:03 +01:00
1 parent 10429f0595
commit 13eadd045b
6 files changed
+110 -96

No files matched your search

@@ -30,26 +30,29 @@ class _TotalsHt
}
}
$odds['difference'] = abs(1 / $odds['over'] - 1 / $odds['under']);
if ($odds['over'] >= 1 && $odds['under'] >= 1) {
$odds['margin'] = (float) Margin::calculate([$odds['over'], $odds['under']], 1);
$odds['difference'] = abs(1 / $odds['over'] - 1 / $odds['under']);
$res = OddsTotalHt::where('event_id', $odds['event_id'])
->where('bookmaker_id', $odds['bookmaker_id'])
->where('total', $odds['total'])
->first();
$odds['margin'] = (float) Margin::calculate([$odds['over'], $odds['under']], 1);
if (! $res) {
OddsTotalHt::create($odds);
} elseif (! $block_update) {
$res->over = $odds['over'];
$res->under = $odds['under'];
$res->flags = 1;
$res->margin = $odds['margin'];
DB::transaction(function () use ($res) {
$res->save();
}, 5);
$res = OddsTotalHt::where('event_id', $odds['event_id'])
->where('bookmaker_id', $odds['bookmaker_id'])
->where('total', $odds['total'])
->first();
if (! $res) {
OddsTotalHt::create($odds);
} elseif (! $block_update) {
$res->over = $odds['over'];
$res->under = $odds['under'];
$res->flags = 1;
$res->margin = $odds['margin'];
DB::transaction(function () use ($res) {
$res->save();
}, 5);
}
}
ActiveSpread::collect($odds, 'odds_totals_ht');