rapper magloo nigeria fixtures ok

This commit is contained in:
salam committed 2026-01-03 12:29:17 +01:00
1 parent 34690292aa
commit 9e7384daf8
46 files changed
+334 -1502

No files matched your search

+90 -78
View File
@@ -11,6 +11,7 @@ use App\Models\OddsDnb;
use App\Models\OddsGgng;
use App\Models\OddsTotal;
use App\Utilities\Margin;
use App\Utilities\Notice;
use Illuminate\Support\Carbon;
class Bet365
@@ -18,16 +19,25 @@ class Bet365
public static function grap()
{
$debug = Nuh::$options['d'] ?? 0;
$break = Nuh::$options['b'] ?? 0;
$week = Nuh::$options['w'] ?? 0;
/**
* Bet365
*/
$bookmaker_id = 126;
$events = Event::where('bet365_id', '>', 0)->where('events.starttime', '>', Carbon::now())->get();
$events = Event::where('bet365_id', '>', 0)->where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDays(1)->toDateTimeString())->select('id', 'sport_id', 'bet365_id', 'starttime')->get();
foreach ($events as $event) {
foreach ($events as $key => $event) {
if ($debug) {
Notice::note([
'id' => $event->id,
'bet365_id' => $event->bet365_id,
'starttime' => $event->starttime,
'count' => count($events).'/'.$key + 1,
], 'b');
}
/**
* BET365 ODDS (per event)
*/
@@ -35,93 +45,95 @@ class Bet365
$data = Curl::load($url);
$offer = $data['results'][0]['main']['sp'];
if (isset($data['results'][0]['main'])) {
$base = [];
$base['sport_id'] = $event->sport_id;
$base['provider_id'] = Nuh::$options['provider_id'];
$base['bmoid'] = $event->bet365_id;
$base['flag'] = 1;
$base['last_check_at'] = Carbon::now();
$offer = $data['results'][0]['main']['sp'];
/**
* 1X2
*/
if (isset($offer['full_time_result'])) {
$odds = [];
$odds['h3w'] = $offer['full_time_result']['odds'][0]['odds'] ?? 1;
$odds['d3w'] = $offer['full_time_result']['odds'][1]['odds'] ?? 1;
$odds['a3w'] = $offer['full_time_result']['odds'][2]['odds'] ?? 1;
$odds['margin'] = (float) Margin::calculate($odds, 1);
$base = [];
$base['sport_id'] = $event->sport_id;
$base['provider_id'] = Nuh::$options['provider_id'];
$base['bmoid'] = $event->bet365_id;
$base['flag'] = 1;
Odds3way::updateOrCreate([
'event_id' => $event->id,
'bookmaker_id' => $bookmaker_id,
], $base + $odds);
}
/**
* 1X2
*/
if (isset($offer['full_time_result'])) {
$odds = [];
$odds['h3w'] = $offer['full_time_result']['odds'][0]['odds'] ?? 1;
$odds['d3w'] = $offer['full_time_result']['odds'][1]['odds'] ?? 1;
$odds['a3w'] = $offer['full_time_result']['odds'][2]['odds'] ?? 1;
$odds['margin'] = (float) Margin::calculate($odds, 1);
/**
* DC
*/
if (isset($offer['double_chance'])) {
$odds = [];
$odds['dc1x'] = $offer['double_chance']['odds'][0]['odds'] ?? 1;
$odds['dc12'] = $offer['double_chance']['odds'][1]['odds'] ?? 1;
$odds['dcx2'] = $offer['double_chance']['odds'][2]['odds'] ?? 1;
$odds['margin'] = (float) Margin::calculate($odds, 1);
OddsDc::updateOrCreate([
'event_id' => $event->id,
'bookmaker_id' => $bookmaker_id,
], $base + $odds);
}
/**
* 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) {
OddsTotal::updateOrCreate([
Odds3way::updateOrCreate([
'event_id' => $event->id,
'bookmaker_id' => $bookmaker_id,
'total' => 2.5,
], $base + $odds);
}
}
/**
* GG NG
*/
if (isset($offer['both_teams_to_score'])) {
$odds = [];
$odds['gg'] = $offer['both_teams_to_score']['odds'][0]['odds'] ?? 1;
$odds['ng'] = $offer['both_teams_to_score']['odds'][1]['odds'] ?? 1;
$odds['margin'] = (float) Margin::calculate($odds, 1);
/**
* DC
*/
if (isset($offer['double_chance'])) {
$odds = [];
$odds['dc1x'] = $offer['double_chance']['odds'][0]['odds'] ?? 1;
$odds['dc12'] = $offer['double_chance']['odds'][1]['odds'] ?? 1;
$odds['dcx2'] = $offer['double_chance']['odds'][2]['odds'] ?? 1;
$odds['margin'] = (float) Margin::calculate($odds, 1);
OddsGgng::updateOrCreate([
'event_id' => $event->id,
'bookmaker_id' => $bookmaker_id,
], $base + $odds);
}
OddsDc::updateOrCreate([
'event_id' => $event->id,
'bookmaker_id' => $bookmaker_id,
], $base + $odds);
}
/**
* DNB
*/
if (isset($offer['draw_no_bet'])) {
$odds = [];
$odds['dnb1'] = $offer['draw_no_bet']['odds'][0]['odds'] ?? 1;
$odds['dnb2'] = $offer['draw_no_bet']['odds'][1]['odds'] ?? 1;
$odds['margin'] = (float) Margin::calculate($odds, 1);
/**
* 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);
OddsDnb::updateOrCreate([
'event_id' => $event->id,
'bookmaker_id' => $bookmaker_id,
], $base + $odds);
if ((float) $offer['goals_over_under']['odds'][1]['name'] == 2.5) {
OddsTotal::updateOrCreate([
'event_id' => $event->id,
'bookmaker_id' => $bookmaker_id,
'total' => 2.5,
], $base + $odds);
}
}
/**
* GG NG
*/
if (isset($offer['both_teams_to_score'])) {
$odds = [];
$odds['gg'] = $offer['both_teams_to_score']['odds'][0]['odds'] ?? 1;
$odds['ng'] = $offer['both_teams_to_score']['odds'][1]['odds'] ?? 1;
$odds['margin'] = (float) Margin::calculate($odds, 1);
OddsGgng::updateOrCreate([
'event_id' => $event->id,
'bookmaker_id' => $bookmaker_id,
], $base + $odds);
}
/**
* DNB
*/
if (isset($offer['draw_no_bet'])) {
$odds = [];
$odds['dnb1'] = $offer['draw_no_bet']['odds'][0]['odds'] ?? 1;
$odds['dnb2'] = $offer['draw_no_bet']['odds'][1]['odds'] ?? 1;
$odds['margin'] = (float) Margin::calculate($odds, 1);
OddsDnb::updateOrCreate([
'event_id' => $event->id,
'bookmaker_id' => $bookmaker_id,
], $base + $odds);
}
}
}
}
@@ -4,7 +4,7 @@ namespace App\Console\Commands\Grapper\Betsapi;
use App\Console\Commands\Curl;
use App\Console\Commands\Nuh;
use App\Mapper\FindEvent;
use App\Mapper\FindFixture;
use App\Mapper\LoadElements;
use App\Mapper\LoadGroups;
use App\Models\Mapper;
@@ -95,7 +95,7 @@ class Fixtures
'group_cc' => strtoupper($row['league']['cc']) ?? '',
];
FindEvent::search($event, self::$groups[$sport_id], self::$elements[$sport_id]);
FindFixture::search($event, self::$groups[$sport_id], self::$elements[$sport_id]);
}
}
}
-3
View File
@@ -11,9 +11,6 @@ class Magloo
{
public static function switch()
{
Nuh::$options['proxy'] = 'https://proxydb1.nuhodds.com/MaglooProxy.php';
switch (Nuh::$options['name']) {
case 'Fixtures':
Fixtures::grap();
@@ -3,25 +3,106 @@
namespace App\Console\Commands\Grapper\Magloo;
use App\Console\Commands\Curl;
use App\Console\Commands\Grapper\Magloo\Odds\BaseUrl;
use App\Console\Commands\Nuh;
use App\Mapper\FindFixture;
use App\Mapper\LoadElements;
use App\Mapper\LoadGroups;
use App\Models\Sport;
use App\Utilities\Notice;
use Illuminate\Support\Carbon;
class Fixtures
{
public static $elements = [];
public static $groups = [];
public static function grap()
{
$debug = Nuh::$options['d'] ?? 0;
$test = Nuh::$options['t'] ?? 0;
$echo = Nuh::$options['e'] ?? 0;
$proxy = Nuh::$options['p'] ?? 0;
dd(Nuh::$options);
$sportmap = Sport::map('magl', 1, [1, 3]);
$sportmap = Sport::map('magl');
self::$elements = LoadElements::load(Nuh::$options['provider_id']);
$url = Url::sports();
self::$groups = LoadGroups::load(Nuh::$options['provider_id']);
$file = Curl::load($url);
if ($proxy) {
Notice::note('PROXY USED', 'r');
}
dd($file);
if ($debug) {
Notice::note('FIXTURES '.Nuh::$options['process'], 'b');
}
$base_url = BaseUrl::get();
/**
* Tornaments
*/
$url = $base_url.'/sport';
$data = Curl::load($url);
if (! is_array($data) or \count($data) == 0) {
Notice::note('no data in feed', 'r', 1);
return;
}
$ligas = [];
foreach ($data as $value) {
$magloo_sport_id = (int) $value['i'];
if (array_key_exists($magloo_sport_id, $sportmap)) {
$tmp = [];
$tmp['sport'] = $value['n'];
$tmp['sport_id'] = $sportmap[$magloo_sport_id];
$tmp['magloo_sport_id'] = $magloo_sport_id;
foreach ($value['C'] as $key => $val1) {
$tmp['country_id'] = $val1['i'];
$tmp['country'] = $val1['n'];
foreach ($val1['T'] as $key => $val2) {
$tmp['group_id'] = $val2['i'];
$tmp['group'] = $val2['n'];
$ligas[] = $tmp;
}
}
}
}
foreach ($ligas as $liga) {
if ($liga['group'] && strpos($liga['group'], 'Simulated') === false) {
$sport_id = $liga['sport_id'];
$url = $base_url.'/tournament/'.$liga['group_id'].'/event';
$data = Curl::load($url);
foreach ($data as $magloo) {
// print_r($magloo);
$event = [];
$event['event_id'] = (int) $magloo['i'];
$event['betradar_id'] = (int) preg_replace('/\D/', '', $magloo['p']);
$event['sport_id'] = $sport_id;
$event['provider_id'] = Nuh::$options['provider_id'];
$event['starttime'] = strtotime($magloo['dt']);
$event['country_id'] = $liga['country_id'];
$event['country'] = $liga['country'];
$event['group_id'] = $liga['group_id'];
$event['group'] = $liga['group'];
$event['starttime'] = Carbon::parse($magloo['dt'])->toDateTimeString();
$teams = explode(' v ', str_replace('|', ' ', $magloo['n']));
$event['home_id'] = $magloo['htId'];
$event['home'] = addslashes($teams[0]);
$event['away_id'] = $magloo['atId'];
$event['away'] = addslashes($teams[1]);
FindFixture::search($event, self::$groups[$sport_id], self::$elements[$sport_id]);
}
}
}
}
}
@@ -1,13 +1,13 @@
<?php
namespace App\Console\Commands\Grapper\Magloo;
namespace App\Console\Commands\Grapper\Magloo\Odds;
use App\Console\Commands\Nuh;
use App\Utilities\Notice;
class Url
class BaseUrl
{
public static function sports()
public static function get()
{
$test = Nuh::$options['t'] ?? 0;
@@ -15,17 +15,17 @@ class Url
case 3:
// KENIA
if ($test) {
return 'https://int.external.api.algorez.com/api/sb/affiliates/30/en/1/prematch/sport';
return 'https://int.external.api.algorez.com/api/sb/affiliates/30/en/1/prematch';
} else {
return 'https://api.externalsvc.com/api/sb/affiliates/30/en/1/prematch/sport';
return 'https://api.externalsvc.com/api/sb/affiliates/30/en/1/prematch';
}
break;
case 4:
// NIGERIA
if ($test) {
return 'https://int.external.api.algorez.com/api/sb/affiliates/20/en/1/prematch/sport';
return 'https://int.external.api.algorez.com/api/sb/affiliates/20/en/1/prematch';
} else {
return 'https://api.externalsvc.com/api/sb/affiliates/20/en/1/prematch/sport';
return 'https://api.externalsvc.com/api/sb/affiliates/20/en/1/prematch';
}
break;
default:
@@ -216,7 +216,6 @@ class Odds
$odds['flag'] = 1;
$odds['provider_id'] = Nuh::$options['provider_id'];
$odds['nuh_check'] = 0;
$odds['last_check_at'] = Carbon::now()->toDateTimeString();
foreach ($book->offer as $offer) {
@@ -11,11 +11,11 @@ class _3Way
{
public static function grap($odds, $offer)
{
$debug = Nuh::$options['d'] ?? 0;
// $debug = Nuh::$options['d'] ?? 0;
if ($debug) {
Notice::note('1X2 '.Nuh::$bookmaker_id, 'b');
}
// if ($debug) {
// Notice::note('1X2 '.Nuh::$bookmaker_id, 'b');
// }
foreach ($offer as $value) {
$odds['h3w'] = (float) $value->o1;
@@ -11,11 +11,11 @@ class _Dc
{
public static function grap($odds, $offer)
{
$debug = Nuh::$options['d'] ?? 0;
// $debug = Nuh::$options['d'] ?? 0;
if ($debug) {
Notice::note('Double Chance '.Nuh::$bookmaker_id, 'b');
}
// if ($debug) {
// Notice::note('Double Chance '.Nuh::$bookmaker_id, 'b');
// }
foreach ($offer as $value) {
$odds['dc1x'] = (float) $value->o1;
@@ -11,11 +11,11 @@ class _Dnb
{
public static function grap($odds, $offer)
{
$debug = Nuh::$options['d'] ?? 0;
// $debug = Nuh::$options['d'] ?? 0;
if ($debug) {
Notice::note('Draw No Bet '.Nuh::$bookmaker_id, 'b');
}
// if ($debug) {
// Notice::note('Draw No Bet '.Nuh::$bookmaker_id, 'b');
// }
foreach ($offer as $value) {
$odds['dnb1'] = (float) $value->o1;
@@ -11,11 +11,11 @@ class _Ggng
{
public static function grap($odds, $offer)
{
$debug = Nuh::$options['d'] ?? 0;
// $debug = Nuh::$options['d'] ?? 0;
if ($debug) {
Notice::note('Goal No Goal '.Nuh::$bookmaker_id, 'b');
}
// if ($debug) {
// Notice::note('Goal No Goal '.Nuh::$bookmaker_id, 'b');
// }
foreach ($offer as $value) {
$odds['gg'] = (float) $value->o1;
@@ -11,11 +11,11 @@ class _Totals
{
public static function grap($odds, $offer)
{
$debug = Nuh::$options['d'] ?? 0;
// $debug = Nuh::$options['d'] ?? 0;
if ($debug) {
Notice::note('Totals '.Nuh::$bookmaker_id, 'b');
}
// if ($debug) {
// Notice::note('Totals '.Nuh::$bookmaker_id, 'b');
// }
foreach ($offer as $value) {
$odds['over'] = (float) $value->o1;
@@ -11,11 +11,11 @@ class _Tq
{
public static function grap($odds, $offer)
{
$debug = Nuh::$options['d'] ?? 0;
// $debug = Nuh::$options['d'] ?? 0;
if ($debug) {
Notice::note('To Qualify '.Nuh::$bookmaker_id, 'b');
}
// if ($debug) {
// Notice::note('To Qualify '.Nuh::$bookmaker_id, 'b');
// }
foreach ($offer as $value) {
$odds['htq'] = (float) $value->o1;
+1 -1
View File
@@ -51,7 +51,7 @@ class Nuh extends Command
$txt .= '--e echo file'.PHP_EOL;
$txt .= '--f force update market'.PHP_EOL;
$txt .= '--p use proxy db1'.PHP_EOL;
$txt .= '--p use proxy'.PHP_EOL;
$txt .= '--q print queries'.PHP_EOL;
$txt .= '--r read data from file '.PHP_EOL;
File diff suppressed because it is too large. Load diff
@@ -197,13 +197,14 @@ class EventsTable
->width(225)
->label('Totals'),
])->searchable(['id', 'betsapi_id', 'betradar_id', 'bet365_id', 'bwin_id'])
->poll('10s')
->poll('5s')
->defaultSort('starttime', 'ASC')
->filters([
Filter::make('events')
->schema([
Select::make('country_id')
->placeholder('Country')
->columnSpan(2)
->hiddenLabel()
->label('')
->searchable()
@@ -223,7 +224,7 @@ class EventsTable
->hiddenLabel()
->label('')
->multiple()
->columnSpan(2)
->columnSpan(3)
->searchable()
->options(function (Get $get) {
if ($get('country_id')) {
@@ -241,7 +242,7 @@ class EventsTable
})
->live(),
DateRangePicker::make('starttime_period')
->columnSpan(2)
->columnSpan(4)
->startPrefix('From')
->displayFormat('d M Y')
->minDate(now())
@@ -251,7 +252,8 @@ class EventsTable
Action::make('reset')
->hiddenLabel()
->color('gray')
->icon('heroicon-o-arrow-path')
->keyBindings(['esc', 'escape'])
->icon('phosphor-x')
->action(function ($livewire) {
$livewire->resetTableFiltersForm(); // Clears all filters
$livewire->tableSearch = ''; // Clears the main search bar
@@ -290,7 +292,7 @@ class EventsTable
}
);
})
->columns(6)->columnSpan(6),
->columns(10)->columnSpan(10),
], layout: FiltersLayout::AboveContent)
->filtersFormColumns(6)
->deferFilters(false)
@@ -2,11 +2,13 @@
namespace App\Mapper;
use App\Models\CompetitionGroupProvider;
use App\Models\ElementProvider;
use App\Models\Event;
use App\Models\Mapper;
use Illuminate\Support\Carbon;
class FindEvent
class FindFixture
{
public static function search($event, &$groups, &$elements)
{
@@ -18,6 +20,10 @@ class FindEvent
$bet365_id = $event['bet365_id'] ?? 0;
$_1xbet_id = $event['_1xbet_id'] ?? 0;
$bwin_id = $event['bwin_id'] ?? 0;
unset($event['event_id']);
switch ($event['provider_id']) {
@@ -41,41 +47,101 @@ class FindEvent
// LOGIFUTUR COLOMBIA
$match_id = Event::where('logcol_id', $event_id)->value('id');
break;
default:
Notice::note('unknown provider', 'r', 1);
break;
}
// DEFAULT BETRADAR
if (! $match_id && $betradar_id) {
$match_id = Event::where('betradar_id', $betradar_id)->value('id');
}
$home_id = $elements[$event['home_id']] ?? 0;
$away_id = $elements[$event['away_id']] ?? 0;
$cgid = $groups[$event['group_id']] ?? 0;
if ($match_id) {
Mapper::where('event_id', $event_id)->delete();
$event = Event::where('id', $match_id)->first();
$match = Event::where('id', $match_id)->first();
if (! $home_id) {
$ele = [];
$ele['sport_id'] = $event['sport_id'];
$ele['provider_id'] = $event['provider_id'];
$ele['element_id'] = $match->home_id ?? 0;
$ele['name'] = $event['home'];
ElementProvider::updateOrCreate(['provider_element_id' => (int) $event['home_id']], $ele);
}
if (! $away_id) {
$ele = [];
$ele['sport_id'] = $event['sport_id'];
$ele['provider_id'] = $event['provider_id'];
$ele['element_id'] = $match->away_id ?? 0;
$ele['name'] = $event['away'];
ElementProvider::updateOrCreate(['provider_element_id' => (int) $event['away_id']], $ele);
}
if (! $cgid) {
$group = [];
$group['sport_id'] = $event['sport_id'];
$group['provider_id'] = $event['provider_id'];
$group['competition_group_id'] = $match->competition_group_id;
$group['name'] = $event['group'];
CompetitionGroupProvider::updateOrCreate(['provider_group_id' => (int) $event['group_id']], $group);
}
$update_array = [];
if ($betradar_id && ! $event->betradar_id) {
if ($betradar_id && ! $match->betradar_id) {
$update_array['betradar_id'] = $betradar_id;
}
if ($betsapi_id && ! $event->betsapi_id) {
if ($betsapi_id && ! $match->betsapi_id) {
$update_array['betsapi_id'] = $betsapi_id;
}
if ($bet365_id && ! $event->bet365_id) {
if ($bet365_id && ! $match->bet365_id) {
$update_array['bet365_id'] = $bet365_id;
}
if ($_1xbet_id && ! $match->_1xbet_id) {
$update_array['bet365_id'] = $_1xbet_id;
}
if ($bwin_id && ! $match->bwin_id) {
$update_array['bwin_id'] = $bwin_id;
}
// event_id
switch ($event['provider_id']) {
case 3:
// MAGLOO KENIA
if (! $match->magken_id) {
$update_array['magken_id'] = $event_id;
}
break;
case 4:
// MAGLOO NIGERIA
if (! $match->magnig_id) {
$update_array['magnig_id'] = $event_id;
}
break;
case 5:
// LOGIFUTUR NIGERA
if (! $match->lognig_id) {
$update_array['lognig_id'] = $event_id;
}
break;
case 6:
// LOGIFUTUR COLOMBIA
if (! $match->logcol_id) {
$update_array['logcol_id'] = $event_id;
}
break;
}
if ($update_array) {
Event::where('id', $match_id)->update($update_array);
exit;
}
} else {
$home_id = $elements[$event['home_id']] ?? 0;
$away_id = $elements[$event['away_id']] ?? 0;
$cgid = $groups[$event['group_id']] ?? 0;
$startime = $event['starttime'];
if ($home_id && $away_id && $cgid) {
+4
View File
@@ -15,6 +15,10 @@ class Event extends Model
'bet365_id',
'_1xbet_id',
'bwin_id',
'magnig_id',
'magken_id',
'lognig_id',
'logcol_id',
'starttime',
'sport_id',
'country_id',
-1
View File
@@ -12,7 +12,6 @@ class EventBookmaker extends Model
'bmoid',
'send_status',
'bkm_starttime',
'last_check_at',
];
public function event()
+2
View File
@@ -14,6 +14,8 @@ class Mapper extends Model
'sport_id',
'provider_id',
'starttime',
'country',
'country_id',
'group',
'group_id',
'group_cc',
-1
View File
@@ -21,7 +21,6 @@ class Odds2way extends Model
'margin',
'flag',
'nuh_check',
'last_check_at',
'source_updated_at',
'add_time',
'updated_at',
-1
View File
@@ -21,7 +21,6 @@ class Odds2wayS1 extends Model
'margin',
'flag',
'nuh_check',
'last_check_at',
'source_updated_at',
'add_time',
'updated_at',
-1
View File
@@ -22,7 +22,6 @@ class Odds3way extends Model
'margin',
'flag',
'nuh_check',
'last_check_at',
'source_updated_at',
'add_time',
'updated_at',
-1
View File
@@ -22,7 +22,6 @@ class OddsDc extends Model
'margin',
'flag',
'nuh_check',
'last_check_at',
'source_updated_at',
'add_time',
'updated_at',
-1
View File
@@ -21,7 +21,6 @@ class OddsDnb extends Model
'margin',
'flag',
'nuh_check',
'last_check_at',
'source_updated_at',
'add_time',
'updated_at',
-1
View File
@@ -21,7 +21,6 @@ class OddsGgng extends Model
'margin',
'flag',
'nuh_check',
'last_check_at',
'source_updated_at',
'add_time',
'updated_at',
-1
View File
@@ -22,7 +22,6 @@ class OddsHandicap extends Model
'margin',
'flag',
'nuh_check',
'last_check_at',
'source_updated_at',
'add_time',
'updated_at',
-1
View File
@@ -22,7 +22,6 @@ class OddsHandicapQ1 extends Model
'margin',
'flag',
'nuh_check',
'last_check_at',
'source_updated_at',
'add_time',
'updated_at',
-1
View File
@@ -21,7 +21,6 @@ class OddsQualify extends Model
'margin',
'flag',
'nuh_check',
'last_check_at',
'source_updated_at',
'add_time',
'updated_at',
-1
View File
@@ -22,7 +22,6 @@ class OddsTotal extends Model
'margin',
'flag',
'nuh_check',
'last_check_at',
'source_updated_at',
'add_time',
'updated_at',
-1
View File
@@ -22,7 +22,6 @@ class OddsTotalQ1 extends Model
'margin',
'flag',
'nuh_check',
'last_check_at',
'source_updated_at',
'add_time',
'updated_at',
+14 -3
View File
@@ -7,13 +7,24 @@ use Illuminate\Database\Eloquent\Model;
class Sport extends Model
{
public static function map($field, $_limit = [])
public static function map($field, $reverse = false, $limit = [])
{
if (! in_array($field, ['bapi', 'bwin', 'b365', 'logi', 'magl'])) {
Notice::note('Sport::map wrong option! Possible options: bapi, bwin, b365, logi, magl', 'r', 1);
}
return Sport::where('is_active', 1)->whereNotIn('id', $_limit)->pluck($field, 'id')->toArray();
if ($reverse) {
if ($limit) {
return Sport::where('is_active', 1)->whereIn('id', $limit)->pluck('id', $field)->toArray();
} else {
return Sport::where('is_active', 1)->pluck('id', $field)->toArray();
}
} else {
if ($limit) {
return Sport::where('is_active', 1)->whereIn($limit, 'id')->pluck('id', $field)->toArray();
} else {
return Sport::where('is_active', 1)->pluck($field, 'id')->toArray();
}
}
}
}
+6
View File
@@ -2,6 +2,7 @@
namespace App\Utilities;
use App\Models\Provider;
use App\Models\Supervisor;
class Supervisorctl
@@ -13,6 +14,7 @@ class Supervisorctl
public static function start(&$options)
{
$debug = $options['d'] ?? 0;
$proxy = $options['p'] ?? 0;
// sleep for 0,5 seconds
usleep(500000);
@@ -29,6 +31,10 @@ class Supervisorctl
}
$options = array_merge($options, $supervisor->toArray());
$options['process'] = Provider::where('id', $options['provider_id'])->value('name');
if ($proxy) {
$options['proxy'] = 'https://prox2.nuhodds.com/proxy.php';
}
if ($options['sleep'] > 0) {
if (! $debug) {
@@ -18,7 +18,6 @@ return new class extends Migration
$table->string('bmoid')->nullable();
$table->boolean('send_status')->default(0);
$table->timestamp('bkm_starttime')->nullable();
$table->timestamp('last_check_at')->nullable();
$table->timestamps();
});
}
@@ -26,7 +26,6 @@ return new class extends Migration
$table->boolean('flag')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamp('starting_time')->nullable();
$table->timestamp('last_check_at')->nullable();
$table->timestamp('source_updated_at')->nullable();
$table->timestamps();
$table->index(['event_id']);
@@ -24,7 +24,6 @@ return new class extends Migration
$table->decimal('margin', 5, 1)->default(0);
$table->boolean('flag')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamp('last_check_at')->nullable();
$table->timestamp('source_updated_at')->nullable();
$table->timestamps();
$table->index(['event_id']);
@@ -25,7 +25,6 @@ return new class extends Migration
$table->boolean('flag')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamp('starting_time')->nullable();
$table->timestamp('last_check_at')->nullable();
$table->timestamp('source_updated_at')->nullable();
$table->timestamps();
$table->index(['event_id']);
@@ -25,7 +25,6 @@ return new class extends Migration
$table->decimal('margin', 5, 1)->default(0);
$table->boolean('flag')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamp('last_check_at')->nullable();
$table->timestamp('source_updated_at')->nullable();
$table->timestamps();
$table->index(['event_id']);
@@ -24,7 +24,6 @@ return new class extends Migration
$table->decimal('margin', 5, 1)->default(0);
$table->boolean('flag')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamp('last_check_at')->nullable();
$table->timestamp('source_updated_at')->nullable();
$table->timestamps();
$table->index(['event_id']);
@@ -24,7 +24,6 @@ return new class extends Migration
$table->decimal('margin', 5, 1)->default(0);
$table->boolean('flag')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamp('last_check_at')->nullable();
$table->timestamp('source_updated_at')->nullable();
$table->timestamps();
$table->index(['event_id']);
@@ -24,7 +24,6 @@ return new class extends Migration
$table->decimal('margin', 5, 1)->default(0);
$table->boolean('flag')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamp('last_check_at')->nullable();
$table->timestamp('source_updated_at')->nullable();
$table->timestamps();
$table->index(['event_id']);
@@ -26,7 +26,6 @@ return new class extends Migration
$table->boolean('flag')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamp('starting_time')->nullable();
$table->timestamp('last_check_at')->nullable();
$table->timestamp('source_updated_at')->nullable();
$table->timestamps();
$table->index(['event_id']);
@@ -25,7 +25,6 @@ return new class extends Migration
$table->decimal('margin', 5, 1)->default(0);
$table->boolean('flag')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamp('last_check_at')->nullable();
$table->timestamp('source_updated_at')->nullable();
$table->timestamps();
$table->index(['event_id']);
@@ -25,7 +25,6 @@ return new class extends Migration
$table->decimal('margin', 5, 1)->default(0);
$table->boolean('flag')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamp('last_check_at')->nullable();
$table->timestamp('source_updated_at')->nullable();
$table->timestamps();
$table->index(['event_id']);
@@ -25,7 +25,6 @@ return new class extends Migration
$table->decimal('margin', 5, 1)->default(0);
$table->boolean('flag')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamp('last_check_at')->nullable();
$table->timestamp('source_updated_at')->nullable();
$table->timestamps();
$table->index(['event_id']);
@@ -20,6 +20,8 @@ return new class extends Migration
$table->integer('sport_id')->index();
$table->integer('provider_id')->default(0)->nullable()->index();
$table->dateTime('starttime')->nullable();
$table->string('country')->nullable();
$table->integer('country_id')->default(0)->nullable()->index();
$table->string('group')->nullable();
$table->integer('group_id')->default(0)->nullable()->index();
$table->string('group_cc')->nullable();
+5 -4
View File
@@ -14,14 +14,15 @@ class SupervisorSeeder extends Seeder
*/
$sql = "INSERT INTO `supervisors` (`id`, `name`, `provider_id`, `sport_id`, `sleep`, `limit`, `runtime`, `maxsconds`, `lastcall`, `is_cron`, `is_active`, `created_at`, `updated_at`)
VALUES
(1, 'Fixtures', 1, 1, 10, 0, '0.042', 1800, 0, 1, 1, '2025-08-27 07:39:55', '2025-12-22 05:20:19'),
(1, 'Fixtures', 1, 1, 10, 0, '0.59', 1800, 0, 1, 1, '2025-08-27 07:39:55', '2026-01-03 09:55:09'),
(2, 'Odds', 1, 1, 10, 0, '0.251', 30, 0, 0, 1, '2025-12-01 05:41:02', '2025-12-22 05:20:40'),
(3, 'Fixtures', 2, 0, 15, 0, NULL, 1800, 0, 1, 1, '2025-12-19 11:42:35', '2025-12-22 06:41:47'),
(4, 'Willhill', 2, 0, 15, 0, '0.235', 1800, 0, 1, 1, '2025-12-19 11:48:05', '2025-12-22 06:41:51'),
(5, 'Bwin', 2, 0, 15, 0, NULL, 1800, 0, 1, 1, '2025-12-22 06:41:18', '2025-12-22 06:41:52'),
(5, 'Bwin', 2, 0, 15, 0, '0.436', 1800, 0, 1, 1, '2025-12-22 06:41:18', '2026-01-03 10:12:40'),
(6, 'Bet365', 2, 0, 10, 0, '0', 30, 0, 0, 1, '2025-12-18 17:44:33', '2026-01-01 17:09:28'),
(7, 'Betfair', 2, 0, 10, 0, '0', 30, 0, 0, 1, '2025-12-18 17:44:33', '2026-01-01 17:09:35'),
(8, 'Fixtures', 4, 0, 10, 0, '0', 30, 0, 1, 1, '2025-12-18 17:44:33', '2026-01-01 17:08:53');
(7, 'Betfair', 2, 0, 10, 0, '0', 30, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-03 12:28:09'),
(8, 'Fixtures', 4, 0, 10, 0, '1.368', 30, 0, 1, 1, '2025-12-18 17:44:33', '2026-01-03 12:24:52'),
(9, 'Odds', 5, 0, 15, 0, NULL, 1800, 0, 0, 1, '2026-01-03 12:27:44', '2026-01-03 12:27:53');
";
DB::unprepared($sql);