wip
This commit is contained in:
1 parent
7dce81013b
commit
668310b03d
12 files changed
+87
-124
No files matched your search
@@ -8,13 +8,14 @@ use App\Console\Commands\Grapper\Magloo\Odds\FilterTotals;
|
||||
use App\Console\Commands\Grapper\Magloo\Odds\FilterTotalsQ1;
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Models\Event;
|
||||
use App\Models\EventBookmaker;
|
||||
use App\Models\Odds3way;
|
||||
use App\Models\OddsDc;
|
||||
use App\Models\OddsHandicap;
|
||||
use App\Models\OddsHandicapQ1;
|
||||
use App\Models\OddsQualify;
|
||||
use App\Models\OddsTotal;
|
||||
use App\Models\OddsTotalQ1;
|
||||
use App\Models\OddsTq;
|
||||
use App\Models\Sport;
|
||||
use App\Utilities\Margin;
|
||||
use App\Utilities\Notice;
|
||||
@@ -27,6 +28,8 @@ class Odds
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
$proxy = Nuh::$options['p'] ?? 0;
|
||||
|
||||
$event_id_collector = [];
|
||||
|
||||
$sportmap = Sport::map('magl', 1, [1, 3]);
|
||||
|
||||
if ($proxy) {
|
||||
@@ -76,7 +79,12 @@ class Odds
|
||||
$base['bmoid'] = preg_replace('/\D/', '', $match['i']);
|
||||
$base['flag'] = 1;
|
||||
|
||||
// dd($match['M']);
|
||||
$event_id_collector[] = $event_id;
|
||||
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], ['in_feed' => 1, 'bmoid' => $base['bmoid']]);
|
||||
|
||||
foreach ($match['M'] as $magloo_bettype_id => $value) {
|
||||
switch ($magloo_bettype_id) {
|
||||
@@ -102,7 +110,7 @@ class Odds
|
||||
$odds['atq'] = $value['static'][5] ?? 1;
|
||||
$odds['margin'] = (float) Margin::calculate($odds, 1);
|
||||
|
||||
OddsQualify::updateOrCreate([
|
||||
OddsTq::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], $base + $odds);
|
||||
@@ -189,5 +197,9 @@ class Odds
|
||||
}
|
||||
}
|
||||
|
||||
EventBookmaker::whereNotIn('event_id', $event_id_collector)
|
||||
->where('bookmaker_id', $bookmaker_id)
|
||||
->update(['in_feed' => 0]);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user