wip db
This commit is contained in:
1 parent
10429f0595
commit
13eadd045b
6 files changed
+110
-96
No files matched your search
@@ -30,26 +30,28 @@ class _TotalsQ1
|
||||
}
|
||||
}
|
||||
|
||||
$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 = OddsTotalQ1::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) {
|
||||
OddsTotalQ1::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 = OddsTotalQ1::where('event_id', $odds['event_id'])
|
||||
->where('bookmaker_id', $odds['bookmaker_id'])
|
||||
->where('total', $odds['total'])
|
||||
->first();
|
||||
|
||||
if (! $res) {
|
||||
OddsTotalQ1::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_q1');
|
||||
|
||||
Reference in new issue
Block a user