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) {
|
if ($debug) {
|
||||||
$arr = [
|
$arr = [
|
||||||
'Mapper TXOdds to Bet365',
|
'Mapper TxOdds to Bet365',
|
||||||
'TXdds ID : '.$event['txodds_id'],
|
'TXdds ID : '.$event['txodds_id'],
|
||||||
"Bet365 ID : $bet365_id",
|
"Bet365 ID : $bet365_id",
|
||||||
'Willhill ID : '.$event['willhill_id'],
|
'Willhill ID : '.$event['willhill_id'],
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class Odds
|
|||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note('TXOdds MARKET Lastcall', 'p');
|
Notice::note('TxOdds MARKET Lastcall', 'p');
|
||||||
}
|
}
|
||||||
|
|
||||||
$market = '&ot='.Nuh::$options['txodds_market_id'];
|
$market = '&ot='.Nuh::$options['txodds_market_id'];
|
||||||
@@ -234,11 +234,9 @@ class Odds
|
|||||||
'competition_group_id' => (int) $row->group['cgid'],
|
'competition_group_id' => (int) $row->group['cgid'],
|
||||||
];
|
];
|
||||||
|
|
||||||
$res = DB::transaction(function () use ($row, $event) {
|
$res = DB::transaction(function () use ($event_id, $event) {
|
||||||
return Event::updateOrCreate(['id' => (int) $row['id']], $event);
|
return Event::updateOrCreate(['id' => (int) $event_id, $event]);
|
||||||
|
|
||||||
}, 5);
|
}, 5);
|
||||||
$event_id = $res->id;
|
|
||||||
|
|
||||||
$group = [
|
$group = [
|
||||||
'competition_group_id' => (string) $row->group['cgid'],
|
'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);
|
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 = [];
|
$bookmaker_id = (int) $book['bid'];
|
||||||
$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;
|
|
||||||
|
|
||||||
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) {
|
$bettypeid = 0;
|
||||||
switch ($attributeName) {
|
|
||||||
case 'id':
|
foreach ($offer->attributes() as $attributeName => $attributeValue) {
|
||||||
$odds['offer_id'] = (int) $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;
|
break;
|
||||||
case 'ot':
|
case 1:
|
||||||
$bettypeid = (int) $attributeValue;
|
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;
|
break;
|
||||||
case 'bmoid':
|
case 3:
|
||||||
$odds['bmoid'] = (string) $attributeValue;
|
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;
|
break;
|
||||||
case 'flags':
|
case 4:
|
||||||
$odds['flags'] = (string) $attributeValue;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ActiveSpread::set($event_id, $bookmaker_id);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+17
-17
@@ -3426,16 +3426,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/commonmark",
|
"name": "league/commonmark",
|
||||||
"version": "2.8.0",
|
"version": "2.8.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/thephpleague/commonmark.git",
|
"url": "https://github.com/thephpleague/commonmark.git",
|
||||||
"reference": "4efa10c1e56488e658d10adf7b7b7dcd19940bfb"
|
"reference": "84b1ca48347efdbe775426f108622a42735a6579"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/4efa10c1e56488e658d10adf7b7b7dcd19940bfb",
|
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/84b1ca48347efdbe775426f108622a42735a6579",
|
||||||
"reference": "4efa10c1e56488e658d10adf7b7b7dcd19940bfb",
|
"reference": "84b1ca48347efdbe775426f108622a42735a6579",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -3460,9 +3460,9 @@
|
|||||||
"phpstan/phpstan": "^1.8.2",
|
"phpstan/phpstan": "^1.8.2",
|
||||||
"phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0",
|
"phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0",
|
||||||
"scrutinizer/ocular": "^1.8.1",
|
"scrutinizer/ocular": "^1.8.1",
|
||||||
"symfony/finder": "^5.3 | ^6.0 | ^7.0",
|
"symfony/finder": "^5.3 | ^6.0 | ^7.0 || ^8.0",
|
||||||
"symfony/process": "^5.4 | ^6.0 | ^7.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",
|
"symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 | ^7.0 || ^8.0",
|
||||||
"unleashedtech/php-coding-standard": "^3.1.1",
|
"unleashedtech/php-coding-standard": "^3.1.1",
|
||||||
"vimeo/psalm": "^4.24.0 || ^5.0.0 || ^6.0.0"
|
"vimeo/psalm": "^4.24.0 || ^5.0.0 || ^6.0.0"
|
||||||
},
|
},
|
||||||
@@ -3529,7 +3529,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2025-11-26T21:48:24+00:00"
|
"time": "2026-03-05T21:37:03+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/config",
|
"name": "league/config",
|
||||||
@@ -11158,16 +11158,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "php-debugbar/php-debugbar",
|
"name": "php-debugbar/php-debugbar",
|
||||||
"version": "v3.4.1",
|
"version": "v3.5.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/php-debugbar/php-debugbar.git",
|
"url": "https://github.com/php-debugbar/php-debugbar.git",
|
||||||
"reference": "ee9c718797a4c1fdf6c4d980cb3edcc1eeeddcc7"
|
"reference": "486b32fd98efe9a3c10f0b24c0caabc187f78f04"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/ee9c718797a4c1fdf6c4d980cb3edcc1eeeddcc7",
|
"url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/486b32fd98efe9a3c10f0b24c0caabc187f78f04",
|
||||||
"reference": "ee9c718797a4c1fdf6c4d980cb3edcc1eeeddcc7",
|
"reference": "486b32fd98efe9a3c10f0b24c0caabc187f78f04",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -11244,7 +11244,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/php-debugbar/php-debugbar/issues",
|
"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": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -11256,7 +11256,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2026-02-26T11:40:30+00:00"
|
"time": "2026-03-05T20:37:33+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "php-debugbar/symfony-bridge",
|
"name": "php-debugbar/symfony-bridge",
|
||||||
@@ -13404,12 +13404,12 @@
|
|||||||
],
|
],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"stability-flags": [],
|
"stability-flags": {},
|
||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": "^8.3"
|
"php": "^8.3"
|
||||||
},
|
},
|
||||||
"platform-dev": [],
|
"platform-dev": {},
|
||||||
"plugin-api-version": "2.6.0"
|
"plugin-api-version": "2.9.0"
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user