wip db
This commit is contained in:
1 parent
10429f0595
commit
13eadd045b
6 files changed
+110
-96
No files matched your search
@@ -24,26 +24,29 @@ class _Points
|
||||
return;
|
||||
}
|
||||
|
||||
$odds['difference'] = abs(1 / $odds['home'] - 1 / $odds['away']);
|
||||
if ($odds['home'] >= 1 && $odds['away'] >= 1) {
|
||||
|
||||
$odds['margin'] = (float) Margin::calculate([$odds['home'], $odds['away']], 1);
|
||||
$odds['difference'] = abs(1 / $odds['home'] - 1 / $odds['away']);
|
||||
|
||||
$res = OddsPoint::where('event_id', $odds['event_id'])
|
||||
->where('bookmaker_id', $odds['bookmaker_id'])
|
||||
->where('handicap', $odds['handicap'])
|
||||
->first();
|
||||
$odds['margin'] = (float) Margin::calculate([$odds['home'], $odds['away']], 1);
|
||||
|
||||
if (! $res) {
|
||||
OddsPoint::create($odds);
|
||||
} elseif (! $block_update) {
|
||||
$res->home = $odds['home'];
|
||||
$res->away = $odds['away'];
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
DB::transaction(function () use ($res) {
|
||||
$res->save();
|
||||
}, 5);
|
||||
$res = OddsPoint::where('event_id', $odds['event_id'])
|
||||
->where('bookmaker_id', $odds['bookmaker_id'])
|
||||
->where('handicap', $odds['handicap'])
|
||||
->first();
|
||||
|
||||
if (! $res) {
|
||||
OddsPoint::create($odds);
|
||||
} elseif (! $block_update) {
|
||||
$res->home = $odds['home'];
|
||||
$res->away = $odds['away'];
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
DB::transaction(function () use ($res) {
|
||||
$res->save();
|
||||
}, 5);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ActiveSpread::collect($odds, 'odds_points');
|
||||
|
||||
Reference in new issue
Block a user