wip
This commit is contained in:
1 parent
132ff8879a
commit
c0db4a9fa2
3 files changed
+146
-144
No files matched your search
@@ -58,7 +58,7 @@ class Willhill
|
||||
|
||||
if ($debug) {
|
||||
$arr = [
|
||||
'Mapper TXOdds to Bet365',
|
||||
'Mapper TxOdds to Bet365',
|
||||
'TXdds ID : '.$event['txodds_id'],
|
||||
"Bet365 ID : $bet365_id",
|
||||
'Willhill ID : '.$event['willhill_id'],
|
||||
|
||||
@@ -92,7 +92,7 @@ class Odds
|
||||
*************************************************/
|
||||
|
||||
if ($debug) {
|
||||
Notice::note('TXOdds MARKET Lastcall', 'p');
|
||||
Notice::note('TxOdds MARKET Lastcall', 'p');
|
||||
}
|
||||
|
||||
$market = '&ot='.Nuh::$options['txodds_market_id'];
|
||||
@@ -234,11 +234,9 @@ class Odds
|
||||
'competition_group_id' => (int) $row->group['cgid'],
|
||||
];
|
||||
|
||||
$res = DB::transaction(function () use ($row, $event) {
|
||||
return Event::updateOrCreate(['id' => (int) $row['id']], $event);
|
||||
|
||||
$res = DB::transaction(function () use ($event_id, $event) {
|
||||
return Event::updateOrCreate(['id' => (int) $event_id, $event]);
|
||||
}, 5);
|
||||
$event_id = $res->id;
|
||||
|
||||
$group = [
|
||||
'competition_group_id' => (string) $row->group['cgid'],
|
||||
@@ -282,140 +280,144 @@ class Odds
|
||||
];
|
||||
ElementGroup::updateOrCreate(['element_id' => (int) $row->ateam['id'], 'group_id' => (int) $row->group['id']], $element_group);
|
||||
|
||||
foreach ($row->bookmaker as $book) {
|
||||
if (Event::where('id', $event_id)->exists()) {
|
||||
// inconsteny with CONSTRAINT when getting only market updates
|
||||
|
||||
ActiveSpread::start();
|
||||
foreach ($row->bookmaker as $book) {
|
||||
|
||||
$bookmaker_id = (int) $book['bid'];
|
||||
ActiveSpread::start();
|
||||
|
||||
$odds = [];
|
||||
$odds['event_id'] = $event_id;
|
||||
$odds['bookmaker_id'] = $bookmaker_id;
|
||||
$odds['sport_id'] = $sport_id;
|
||||
$odds['provider_id'] = Nuh::$options['provider_id'];
|
||||
$odds['flags'] = 1;
|
||||
$bookmaker_id = (int) $book['bid'];
|
||||
|
||||
foreach ($book->offer as $offer) {
|
||||
$odds = [];
|
||||
$odds['event_id'] = $event_id;
|
||||
$odds['bookmaker_id'] = $bookmaker_id;
|
||||
$odds['sport_id'] = $sport_id;
|
||||
$odds['provider_id'] = Nuh::$options['provider_id'];
|
||||
$odds['flags'] = 1;
|
||||
|
||||
$bettypeid = 0;
|
||||
foreach ($book->offer as $offer) {
|
||||
|
||||
foreach ($offer->attributes() as $attributeName => $attributeValue) {
|
||||
switch ($attributeName) {
|
||||
case 'id':
|
||||
$odds['offer_id'] = (int) $attributeValue;
|
||||
$bettypeid = 0;
|
||||
|
||||
foreach ($offer->attributes() as $attributeName => $attributeValue) {
|
||||
switch ($attributeName) {
|
||||
case 'id':
|
||||
$odds['offer_id'] = (int) $attributeValue;
|
||||
break;
|
||||
case 'ot':
|
||||
$bettypeid = (int) $attributeValue;
|
||||
break;
|
||||
case 'bmoid':
|
||||
$odds['bmoid'] = (string) $attributeValue;
|
||||
break;
|
||||
case 'flags':
|
||||
$odds['flags'] = (string) $attributeValue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch ($bettypeid) {
|
||||
case 0:
|
||||
foreach ($offer->odds->attributes() as $attributeName => $attributeValue) {
|
||||
switch ($attributeName) {
|
||||
case 'starting_time':
|
||||
DB::transaction(function () use ($odds, $sport_id, $event_id, $bookmaker_id, $attributeValue) {
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'sport_id' => $sport_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], ['in_feed' => 1, 'bmoid' => $odds['bmoid'], 'starttime' => $attributeValue]);
|
||||
|
||||
}, 5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Odds_3Way::grap($odds, $offer);
|
||||
break;
|
||||
case 'ot':
|
||||
$bettypeid = (int) $attributeValue;
|
||||
case 1:
|
||||
foreach ($offer->odds->attributes() as $attributeName => $attributeValue) {
|
||||
switch ($attributeName) {
|
||||
case 'starting_time':
|
||||
DB::transaction(function () use ($odds, $sport_id, $event_id, $bookmaker_id, $attributeValue) {
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'sport_id' => $sport_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], ['in_feed' => 1, 'bmoid' => $odds['bmoid'], 'starttime' => $attributeValue]);
|
||||
|
||||
}, 5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Odds_2Way::grap($odds, $offer);
|
||||
|
||||
break;
|
||||
case 'bmoid':
|
||||
$odds['bmoid'] = (string) $attributeValue;
|
||||
case 3:
|
||||
foreach ($offer->odds->attributes() as $attributeName => $attributeValue) {
|
||||
switch ($attributeName) {
|
||||
case 'starting_time':
|
||||
DB::transaction(function () use ($odds, $sport_id, $event_id, $bookmaker_id, $attributeValue) {
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'sport_id' => $sport_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], ['in_feed' => 1, 'bmoid' => $odds['bmoid'], 'starttime' => $attributeValue]);
|
||||
|
||||
}, 5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Odds_Points::grap($odds, $offer);
|
||||
break;
|
||||
case 'flags':
|
||||
$odds['flags'] = (string) $attributeValue;
|
||||
case 4:
|
||||
Odds_Totals::grap($odds, $offer);
|
||||
break;
|
||||
|
||||
case 131073:
|
||||
Odds_2WayS1::grap($odds, $offer);
|
||||
break;
|
||||
|
||||
case 65536:
|
||||
Odds_3WayHt::grap($odds, $offer);
|
||||
break;
|
||||
case 65540:
|
||||
Odds_TotalsHt::grap($odds, $offer);
|
||||
break;
|
||||
case 65539:
|
||||
Odds_PointsHt::grap($odds, $offer);
|
||||
break;
|
||||
|
||||
case 131075:
|
||||
Odds_PointsQ1::grap($odds, $offer);
|
||||
break;
|
||||
case 131076:
|
||||
Odds_TotalsQ1::grap($odds, $offer);
|
||||
break;
|
||||
|
||||
case 5242880:
|
||||
Odds_Dc::grap($odds, $offer);
|
||||
break;
|
||||
case 6291457:
|
||||
Odds_Dnb::grap($odds, $offer);
|
||||
break;
|
||||
case 11534337:
|
||||
Odds_Ggng::grap($odds, $offer);
|
||||
break;
|
||||
case 7340033:
|
||||
Odds_Tq::grap($odds, $offer);
|
||||
break;
|
||||
|
||||
default:
|
||||
Notice::note('switch bettype ID not found: '.$bettypeid, 'r');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch ($bettypeid) {
|
||||
case 0:
|
||||
foreach ($offer->odds->attributes() as $attributeName => $attributeValue) {
|
||||
switch ($attributeName) {
|
||||
case 'starting_time':
|
||||
DB::transaction(function () use ($odds, $sport_id, $event_id, $bookmaker_id, $attributeValue) {
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'sport_id' => $sport_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], ['in_feed' => 1, 'bmoid' => $odds['bmoid'], 'starttime' => $attributeValue]);
|
||||
|
||||
}, 5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Odds_3Way::grap($odds, $offer);
|
||||
break;
|
||||
case 1:
|
||||
foreach ($offer->odds->attributes() as $attributeName => $attributeValue) {
|
||||
switch ($attributeName) {
|
||||
case 'starting_time':
|
||||
DB::transaction(function () use ($odds, $sport_id, $event_id, $bookmaker_id, $attributeValue) {
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'sport_id' => $sport_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], ['in_feed' => 1, 'bmoid' => $odds['bmoid'], 'starttime' => $attributeValue]);
|
||||
|
||||
}, 5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Odds_2Way::grap($odds, $offer);
|
||||
|
||||
break;
|
||||
case 3:
|
||||
foreach ($offer->odds->attributes() as $attributeName => $attributeValue) {
|
||||
switch ($attributeName) {
|
||||
case 'starting_time':
|
||||
DB::transaction(function () use ($odds, $sport_id, $event_id, $bookmaker_id, $attributeValue) {
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'sport_id' => $sport_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], ['in_feed' => 1, 'bmoid' => $odds['bmoid'], 'starttime' => $attributeValue]);
|
||||
|
||||
}, 5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Odds_Points::grap($odds, $offer);
|
||||
break;
|
||||
case 4:
|
||||
Odds_Totals::grap($odds, $offer);
|
||||
break;
|
||||
|
||||
case 131073:
|
||||
Odds_2WayS1::grap($odds, $offer);
|
||||
break;
|
||||
|
||||
case 65536:
|
||||
Odds_3WayHt::grap($odds, $offer);
|
||||
break;
|
||||
case 65540:
|
||||
Odds_TotalsHt::grap($odds, $offer);
|
||||
break;
|
||||
case 65539:
|
||||
Odds_PointsHt::grap($odds, $offer);
|
||||
break;
|
||||
|
||||
case 131075:
|
||||
Odds_PointsQ1::grap($odds, $offer);
|
||||
break;
|
||||
case 131076:
|
||||
Odds_TotalsQ1::grap($odds, $offer);
|
||||
break;
|
||||
|
||||
case 5242880:
|
||||
Odds_Dc::grap($odds, $offer);
|
||||
break;
|
||||
case 6291457:
|
||||
Odds_Dnb::grap($odds, $offer);
|
||||
break;
|
||||
case 11534337:
|
||||
Odds_Ggng::grap($odds, $offer);
|
||||
break;
|
||||
case 7340033:
|
||||
Odds_Tq::grap($odds, $offer);
|
||||
break;
|
||||
|
||||
default:
|
||||
Notice::note('switch bettype ID not found: '.$bettypeid, 'r');
|
||||
break;
|
||||
}
|
||||
ActiveSpread::set($event_id, $bookmaker_id);
|
||||
}
|
||||
ActiveSpread::set($event_id, $bookmaker_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+17
-17
@@ -3426,16 +3426,16 @@
|
||||
},
|
||||
{
|
||||
"name": "league/commonmark",
|
||||
"version": "2.8.0",
|
||||
"version": "2.8.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/thephpleague/commonmark.git",
|
||||
"reference": "4efa10c1e56488e658d10adf7b7b7dcd19940bfb"
|
||||
"reference": "84b1ca48347efdbe775426f108622a42735a6579"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/4efa10c1e56488e658d10adf7b7b7dcd19940bfb",
|
||||
"reference": "4efa10c1e56488e658d10adf7b7b7dcd19940bfb",
|
||||
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/84b1ca48347efdbe775426f108622a42735a6579",
|
||||
"reference": "84b1ca48347efdbe775426f108622a42735a6579",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3460,9 +3460,9 @@
|
||||
"phpstan/phpstan": "^1.8.2",
|
||||
"phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0",
|
||||
"scrutinizer/ocular": "^1.8.1",
|
||||
"symfony/finder": "^5.3 | ^6.0 | ^7.0",
|
||||
"symfony/process": "^5.4 | ^6.0 | ^7.0",
|
||||
"symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 | ^7.0",
|
||||
"symfony/finder": "^5.3 | ^6.0 | ^7.0 || ^8.0",
|
||||
"symfony/process": "^5.4 | ^6.0 | ^7.0 || ^8.0",
|
||||
"symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 | ^7.0 || ^8.0",
|
||||
"unleashedtech/php-coding-standard": "^3.1.1",
|
||||
"vimeo/psalm": "^4.24.0 || ^5.0.0 || ^6.0.0"
|
||||
},
|
||||
@@ -3529,7 +3529,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-11-26T21:48:24+00:00"
|
||||
"time": "2026-03-05T21:37:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/config",
|
||||
@@ -11158,16 +11158,16 @@
|
||||
},
|
||||
{
|
||||
"name": "php-debugbar/php-debugbar",
|
||||
"version": "v3.4.1",
|
||||
"version": "v3.5.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-debugbar/php-debugbar.git",
|
||||
"reference": "ee9c718797a4c1fdf6c4d980cb3edcc1eeeddcc7"
|
||||
"reference": "486b32fd98efe9a3c10f0b24c0caabc187f78f04"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/ee9c718797a4c1fdf6c4d980cb3edcc1eeeddcc7",
|
||||
"reference": "ee9c718797a4c1fdf6c4d980cb3edcc1eeeddcc7",
|
||||
"url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/486b32fd98efe9a3c10f0b24c0caabc187f78f04",
|
||||
"reference": "486b32fd98efe9a3c10f0b24c0caabc187f78f04",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -11244,7 +11244,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/php-debugbar/php-debugbar/issues",
|
||||
"source": "https://github.com/php-debugbar/php-debugbar/tree/v3.4.1"
|
||||
"source": "https://github.com/php-debugbar/php-debugbar/tree/v3.5.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -11256,7 +11256,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2026-02-26T11:40:30+00:00"
|
||||
"time": "2026-03-05T20:37:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "php-debugbar/symfony-bridge",
|
||||
@@ -13404,12 +13404,12 @@
|
||||
],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": [],
|
||||
"stability-flags": {},
|
||||
"prefer-stable": true,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": "^8.3"
|
||||
},
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "2.6.0"
|
||||
"platform-dev": {},
|
||||
"plugin-api-version": "2.9.0"
|
||||
}
|
||||
Reference in new issue
Block a user