bet365 halftime 1x2
This commit is contained in:
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\Console\Commands\Nuh;
|
||||||
use App\Models\Event;
|
use App\Models\Event;
|
||||||
use App\Models\Odds3way;
|
use App\Models\Odds3way;
|
||||||
|
use App\Models\Odds3wayHt;
|
||||||
use App\Models\OddsDc;
|
use App\Models\OddsDc;
|
||||||
use App\Models\OddsDnb;
|
use App\Models\OddsDnb;
|
||||||
use App\Models\OddsGgng;
|
use App\Models\OddsGgng;
|
||||||
@@ -24,12 +25,16 @@ class Bet365
|
|||||||
|
|
||||||
$week = Nuh::$options['w'] ?? 0;
|
$week = Nuh::$options['w'] ?? 0;
|
||||||
|
|
||||||
|
$single = Nuh::$options['id'] ?? 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bet365
|
* Bet365
|
||||||
*/
|
*/
|
||||||
$bookmaker_id = 126;
|
$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();
|
$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) {
|
} 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();
|
$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
|
* OU
|
||||||
*/
|
*/
|
||||||
if (isset($offer['goals_over_under'])) {
|
if (isset($offer['goals_over_under'])) {
|
||||||
|
|
||||||
$odds = [];
|
$odds = [];
|
||||||
$odds['over'] = $offer['goals_over_under']['odds'][0]['odds'] ?? 1;
|
$odds['over'] = $offer['goals_over_under']['odds'][0]['odds'] ?? 1;
|
||||||
$odds['under'] = $offer['goals_over_under']['odds'][1]['odds'] ?? 1;
|
$odds['under'] = $offer['goals_over_under']['odds'][1]['odds'] ?? 1;
|
||||||
$odds['margin'] = (float) Margin::calculate($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([
|
OddsTotal::updateOrCreate([
|
||||||
'event_id' => $event->id,
|
'event_id' => $event->id,
|
||||||
'bookmaker_id' => $bookmaker_id,
|
'bookmaker_id' => $bookmaker_id,
|
||||||
@@ -144,6 +150,27 @@ class Bet365
|
|||||||
'bookmaker_id' => $bookmaker_id,
|
'bookmaker_id' => $bookmaker_id,
|
||||||
], $base + $odds);
|
], $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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ use App\Console\Commands\Nuh;
|
|||||||
use App\Console\Commands\Xml;
|
use App\Console\Commands\Xml;
|
||||||
use App\Models\CompetitionGroup;
|
use App\Models\CompetitionGroup;
|
||||||
use App\Models\Element;
|
use App\Models\Element;
|
||||||
|
use App\Models\ElementGroup;
|
||||||
use App\Models\Event;
|
use App\Models\Event;
|
||||||
use App\Models\Group;
|
use App\Models\Group;
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
@@ -244,6 +245,8 @@ class Odds
|
|||||||
|
|
||||||
foreach ($data as $row) {
|
foreach ($data as $row) {
|
||||||
|
|
||||||
|
$sport_id = (int) $row->group['spid'];
|
||||||
|
|
||||||
$event = [
|
$event = [
|
||||||
'provider_id' => (int) Nuh::$options['provider_id'],
|
'provider_id' => (int) Nuh::$options['provider_id'],
|
||||||
'starttime' => Carbon::createFromDate((string) $row->time)->toDateTimeString(),
|
'starttime' => Carbon::createFromDate((string) $row->time)->toDateTimeString(),
|
||||||
@@ -275,16 +278,28 @@ class Odds
|
|||||||
|
|
||||||
$element = [
|
$element = [
|
||||||
'name' => (string) $row->hteam,
|
'name' => (string) $row->hteam,
|
||||||
'sport_id' => (int) $row->group['spid'],
|
'sport_id' => (int) $sport_id,
|
||||||
|
'country_id' => (int) $row->group['cnid'],
|
||||||
];
|
];
|
||||||
Element::updateOrCreate(['id' => (int) $row->hteam['id']], $element);
|
Element::updateOrCreate(['id' => (int) $row->hteam['id']], $element);
|
||||||
|
|
||||||
|
$element_group = [
|
||||||
|
'competition_group_id' => (int) $row->group['cgid'],
|
||||||
|
];
|
||||||
|
ElementGroup::updateOrCreate(['element_id' => (int) $row->hteam['id'], 'group_id' => (int) $row->group['id']], $element_group);
|
||||||
|
|
||||||
$element = [
|
$element = [
|
||||||
'name' => (string) $row->ateam,
|
'name' => (string) $row->ateam,
|
||||||
'sport_id' => (int) $row->group['spid'],
|
'sport_id' => (int) $sport_id,
|
||||||
|
'country_id' => (int) $row->group['cnid'],
|
||||||
];
|
];
|
||||||
Element::updateOrCreate(['id' => (int) $row->ateam['id']], $element);
|
Element::updateOrCreate(['id' => (int) $row->ateam['id']], $element);
|
||||||
|
|
||||||
|
$element_group = [
|
||||||
|
'competition_group_id' => (int) $row->group['cgid'],
|
||||||
|
];
|
||||||
|
ElementGroup::updateOrCreate(['element_id' => (int) $row->ateam['id'], 'group_id' => (int) $row->group['id']], $element_group);
|
||||||
|
|
||||||
Nuh::$collector = [];
|
Nuh::$collector = [];
|
||||||
|
|
||||||
foreach ($row->bookmaker as $book) {
|
foreach ($row->bookmaker as $book) {
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ class EventsTable
|
|||||||
->searchable()
|
->searchable()
|
||||||
->preload()
|
->preload()
|
||||||
->options(function () {
|
->options(function () {
|
||||||
$res = Event::query()->whereDate('starttime', '>', Carbon::now())->groupBy('country_id')->pluck('country_id')->toArray();
|
$res = Event::query()->where('starttime', '>', Carbon::now())->groupBy('country_id')->pluck('country_id')->toArray();
|
||||||
|
|
||||||
return Country::query()->whereIn('id', $res)->pluck('name', 'id');
|
return Country::query()->whereIn('id', $res)->pluck('name', 'id');
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in new issue
Block a user