bet365 halftime 1x2

This commit is contained in:
salam committed 2026-01-12 05:56:16 +01:00
1 parent 31a0ccdf3b
commit 6e12c1d098
3 files changed
+47 -5

No files matched your search

@@ -6,6 +6,7 @@ use App\Console\Commands\Curl;
use App\Console\Commands\Nuh;
use App\Models\Event;
use App\Models\Odds3way;
use App\Models\Odds3wayHt;
use App\Models\OddsDc;
use App\Models\OddsDnb;
use App\Models\OddsGgng;
@@ -24,12 +25,16 @@ class Bet365
$week = Nuh::$options['w'] ?? 0;
$single = Nuh::$options['id'] ?? 0;
/**
* Bet365
*/
$bookmaker_id = 126;
if ($today) {
if ($single) {
$events = Event::where('id', Nuh::$options['id'])->select('id', 'sport_id', 'bet365_id', 'starttime')->get();
} elseif ($today) {
$events = Event::where('bet365_id', '>', 0)->where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDay()->toDateTimeString())->select('id', 'sport_id', 'bet365_id', 'starttime')->get();
} elseif ($week) {
$events = Event::where('bet365_id', '>', 0)->where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDays(7)->toDateTimeString())->select('id', 'sport_id', 'bet365_id', 'starttime')->get();
@@ -101,12 +106,13 @@ class Bet365
* OU
*/
if (isset($offer['goals_over_under'])) {
$odds = [];
$odds['over'] = $offer['goals_over_under']['odds'][0]['odds'] ?? 1;
$odds['under'] = $offer['goals_over_under']['odds'][1]['odds'] ?? 1;
$odds['margin'] = (float) Margin::calculate($odds, 1);
if ((float) $offer['goals_over_under']['odds'][1]['name'] == 2.5) {
if ($offer['goals_over_under']['odds'][1]['name'] == '2.5') {
OddsTotal::updateOrCreate([
'event_id' => $event->id,
'bookmaker_id' => $bookmaker_id,
@@ -144,6 +150,27 @@ class Bet365
'bookmaker_id' => $bookmaker_id,
], $base + $odds);
}
/**
* HALFTIME
*/
$offer = $data['results'][0]['half']['sp'] ?? '';
/**
* 1X2 HT
*/
if (isset($offer['half_time_result'])) {
$odds = [];
$odds['h3w'] = $offer['half_time_result']['odds'][0]['odds'] ?? 1;
$odds['d3w'] = $offer['half_time_result']['odds'][1]['odds'] ?? 1;
$odds['a3w'] = $offer['half_time_result']['odds'][2]['odds'] ?? 1;
$odds['margin'] = (float) Margin::calculate($odds, 1);
Odds3wayHt::updateOrCreate([
'event_id' => $event->id,
'bookmaker_id' => $bookmaker_id,
], $base + $odds);
}
}
}
}