From 5c9745b1da234a469bfb023919fc392a403a8689 Mon Sep 17 00:00:00 2001 From: salam Date: Thu, 18 Dec 2025 19:22:34 +0100 Subject: [PATCH] wip --- app/Console/Commands/Curl.php | 19 +++++--- app/Console/Commands/Grapper/Magloo.php | 33 +++++++++++++ .../Grapper/{TxSwitch.php => TxOdds.php} | 12 ++--- .../Commands/Grapper/TxOdds/Countries.php | 6 +-- .../Commands/Grapper/TxOdds/Fixtures.php | 12 ++--- app/Console/Commands/Grapper/TxOdds/Odds.php | 48 ++++++++++--------- .../Commands/Grapper/TxOdds/Odds/_3Way.php | 14 +++--- .../Commands/Grapper/TxOdds/Odds/_Dc.php | 12 ++--- .../Commands/Grapper/TxOdds/Odds/_Dnb.php | 12 ++--- .../Commands/Grapper/TxOdds/Odds/_Ggng.php | 12 ++--- .../Commands/Grapper/TxOdds/Odds/_Totals.php | 12 ++--- .../Commands/Grapper/TxOdds/Odds/_Tq.php | 12 ++--- app/Console/Commands/{NuhBash.php => Nuh.php} | 28 +++++++---- app/Console/Commands/Xml.php | 8 ++-- app/Models/Sport.php | 10 +++- ...25_05_17_074558_create_providers_table.php | 1 - database/seeders/DatabaseSeeder.php | 1 - database/seeders/ProvoiderSeeder.php | 15 +++--- database/seeders/SupervisorSeeder.php | 5 +- 19 files changed, 167 insertions(+), 105 deletions(-) create mode 100644 app/Console/Commands/Grapper/Magloo.php rename app/Console/Commands/Grapper/{TxSwitch.php => TxOdds.php} (70%) rename app/Console/Commands/{NuhBash.php => Nuh.php} (83%) diff --git a/app/Console/Commands/Curl.php b/app/Console/Commands/Curl.php index a616f2e4..ff58d92d 100644 --- a/app/Console/Commands/Curl.php +++ b/app/Console/Commands/Curl.php @@ -8,11 +8,11 @@ class Curl { public static $file; - public static function load($url) + public static function load($url, $proxy = false) { - $debug = NuhBash::$options['d'] ?? 0; - $save = NuhBash::$options['s'] ?? 0; - $read = NuhBash::$options['r'] ?? 0; + $debug = Nuh::$options['d'] ?? 0; + $save = Nuh::$options['s'] ?? 0; + $read = Nuh::$options['r'] ?? 0; if ($debug) { Notice::note($url); @@ -22,7 +22,7 @@ class Curl if ($debug) { Notice::note('READ LOCAL', 'r'); } - $filename = app_path().'/Console/TestFiles/'.strtolower(str_replace(' ', '_', NuhBash::$options['name'])).'.json'; + $filename = app_path().'/Console/TestFiles/'.strtolower(str_replace(' ', '_', Nuh::$options['name'])).'.json'; $file = file_get_contents($filename); @@ -34,6 +34,13 @@ class Curl curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FAILONERROR, true); + if ($proxy) { + curl_setopt($request, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($request, CURLOPT_HTTPHEADER, [ + 'Proxy-Auth: $2y$12$/iKduDrM9HJA6T6t/5e5x.nkQ9KUNWLvTXhRwdU.EN2Twfwlr4jzu', + 'Proxy-Target-URL: '.$url, + ]); + } $data = curl_exec($ch); $curl_errorno = curl_errno($ch); if ($curl_errorno) { @@ -46,7 +53,7 @@ class Curl if ($save) { Notice::note('SAVED LOCAL', 'b'); - self::$file = app_path().'/Console/TestFiles/'.strtolower(str_replace(' ', '_', NuhBash::$options['name'])).'.json'; + self::$file = app_path().'/Console/TestFiles/'.strtolower(str_replace(' ', '_', Nuh::$options['name'])).'.json'; file_put_contents(self::$file, $data); } diff --git a/app/Console/Commands/Grapper/Magloo.php b/app/Console/Commands/Grapper/Magloo.php new file mode 100644 index 00000000..db9a7e0b --- /dev/null +++ b/app/Console/Commands/Grapper/Magloo.php @@ -0,0 +1,33 @@ +addDays($i)->toDateString(); $to = $now->addDays($i + 1)->toDateString(); - $url = 'https://xml2.txodds.com/feed/result/xml.php?'.NuhBash::$AUTHTOKEN."&date=$from,$to"; + $url = 'https://xml2.txodds.com/feed/result/xml.php?'.Nuh::$AUTHTOKEN."&date=$from,$to"; $data = Xml::load($url); - if ($print) { + if ($echo) { dd($data); } diff --git a/app/Console/Commands/Grapper/TxOdds/Odds.php b/app/Console/Commands/Grapper/TxOdds/Odds.php index e81d3109..5f6813d6 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds.php @@ -8,7 +8,7 @@ use App\Console\Commands\Grapper\TxOdds\Odds\_Dnb; use App\Console\Commands\Grapper\TxOdds\Odds\_Ggng; use App\Console\Commands\Grapper\TxOdds\Odds\_Totals; use App\Console\Commands\Grapper\TxOdds\Odds\_Tq; -use App\Console\Commands\NuhBash; +use App\Console\Commands\Nuh; use App\Console\Commands\Xml; use App\Models\CompetitionGroup; use App\Models\Element; @@ -23,10 +23,10 @@ class Odds public static function grap() { - $debug = NuhBash::$options['d'] ?? 0; + $debug = Nuh::$options['d'] ?? 0; if ($debug) { - Notice::note('txodd odd sport: '.NuhBash::$options['sport_id'], 'b'); + Notice::note('txodd odd sport: '.Nuh::$options['sport_id'], 'b'); } /************************************************* @@ -79,9 +79,10 @@ class Odds *************************************************/ - $debug = NuhBash::$options['d'] ?? 0; + $debug = Nuh::$options['d'] ?? 0; + $echo = Nuh::$options['e'] ?? 0; - switch (NuhBash::$options['sport_id']) { + switch (Nuh::$options['sport_id']) { case 1: $markets = '0,4,11534337,5242880,7340033,6291457'; break; @@ -107,22 +108,22 @@ class Odds /************************************************* * URL *************************************************/ - $url = 'https://xml2.txodds.com/feed/odds/xml.php?'.NuhBash::$AUTHTOKEN.'&all_odds=2&spid='.NuhBash::$options['sport_id']; + $url = 'https://xml2.txodds.com/feed/odds/xml.php?'.Nuh::$AUTHTOKEN.'&all_odds=2&spid='.Nuh::$options['sport_id']; $_calls = []; - if (NuhBash::$options['event_id']) { - $_calls[] = $url."&ot=$markets&peid=".NuhBash::$options['event_id']; - } elseif (NuhBash::$options['a']) { + if (Nuh::$options['event_id']) { + $_calls[] = $url."&ot=$markets&peid=".Nuh::$options['event_id']; + } elseif (Nuh::$options['a']) { $res = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->pluck('tx_id'); foreach ($res as $id) { $_calls[] = $url."&ot=$markets&peid=".$id; } - } elseif (NuhBash::$options['w']) { + } elseif (Nuh::$options['w']) { $res = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDays(7)->toDateTimeString())->pluck('tx_id'); foreach ($res as $id) { $_calls[] = $url."&ot=$markets&peid=".$id; } } else { - $_calls[] = $url.'&last='.NuhBash::$options['lastcall']; + $_calls[] = $url.'&last='.Nuh::$options['lastcall']; } /************************************************* @@ -132,6 +133,10 @@ class Odds $data = Xml::load($url); + if ($echo) { + dd($data); + } + foreach ($data as $row) { $event = []; @@ -177,19 +182,18 @@ class Odds 'sport_id' => $event['sport_id'], ]); - NuhBash::$_event = Event::firstOrCreate($event, ['starttime' => $event['starttime']]); + Nuh::$_event = Event::firstOrCreate($event, ['starttime' => $event['starttime']]); foreach ($row->bookmaker as $book) { - NuhBash::$bookmaker_id = (int) $book['bid']; + Nuh::$bookmaker_id = (int) $book['bid']; - NuhBash::$bookmaker_id = (int) $book['bid']; + Nuh::$bookmaker_id = (int) $book['bid']; $odds = []; $odds['sport_id'] = (int) $event['sport_id']; - $odds['provider_id'] = 2; - NuhBash::$_event_bookmaker = []; + Nuh::$_event_bookmaker = []; foreach ($book->offer as $offer) { @@ -238,15 +242,15 @@ class Odds } } - foreach (NuhBash::$_event_bookmaker as $value) { + foreach (Nuh::$_event_bookmaker as $value) { EventBookmaker::updateOrCreate([ - 'event_id' => NuhBash::$_event->id, - 'bookmaker_id' => NuhBash::$bookmaker_id, - 'bookmaker_id' => NuhBash::$bookmaker_id, + 'event_id' => Nuh::$_event->id, + 'bookmaker_id' => Nuh::$bookmaker_id, + 'bookmaker_id' => Nuh::$bookmaker_id, ], [ 'bmoid' => $value['bmoid'], - 'provider_id' => 2, + 'provider_id' => Nuh::$options['provider_id'], 'bkm_starttime' => Carbon::createFromDate($value['starttime'])->toDateTimeString(), 'last_check_at' => Carbon::now()->toDateTimeString(), ]); @@ -255,7 +259,7 @@ class Odds } if ($debug) { - Notice::note('END '.NuhBash::$_event->id, 'g'); + Notice::note('END '.Nuh::$_event->id, 'g'); Notice::note('END', 'g'); } } diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_3Way.php b/app/Console/Commands/Grapper/TxOdds/Odds/_3Way.php index d1c27b35..ac4a27a7 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_3Way.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_3Way.php @@ -2,7 +2,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; -use App\Console\Commands\NuhBash; +use App\Console\Commands\Nuh; use App\Models\Odds3way; use App\Utilities\Margin; use App\Utilities\Notice; @@ -12,10 +12,10 @@ class _3Way { public static function grap($odds, $offer) { - $debug = NuhBash::$options['d'] ?? 0; + $debug = Nuh::$options['d'] ?? 0; if ($debug) { - Notice::note('1X2 '.NuhBash::$bookmaker_id, 'b'); + Notice::note('1X2 '.Nuh::$bookmaker_id, 'b'); } $update_array = []; @@ -27,7 +27,7 @@ class _3Way $bkm_starttime = (string) $value['starting_time']; } - NuhBash::$_event_bookmaker[] = + Nuh::$_event_bookmaker[] = [ 'bmoid' => $odds['bmoid'], 'starttime' => $bkm_starttime, @@ -37,14 +37,14 @@ class _3Way $update_array['sport_id'] = $odds['sport_id']; $update_array['offer_id'] = $odds['offer_id']; $update_array['flag'] = 1; - $update_array['provider_id'] = $odds['provider_id']; + $update_array['provider_id'] = Nuh::$options['provider_id']; $update_array['nuh_check'] = 0; $update_array['last_check_at'] = Carbon::now()->toDateTimeString(); $update_array['source_updated_at'] = $odds['source_updated_at']; Odds3way::updateOrCreate([ - 'event_id' => NuhBash::$_event->id, - 'bookmaker_id' => NuhBash::$bookmaker_id, + 'event_id' => Nuh::$_event->id, + 'bookmaker_id' => Nuh::$bookmaker_id, ], $update_array); } } diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_Dc.php b/app/Console/Commands/Grapper/TxOdds/Odds/_Dc.php index 2a9b31f0..965a2b2f 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_Dc.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_Dc.php @@ -2,7 +2,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; -use App\Console\Commands\NuhBash; +use App\Console\Commands\Nuh; use App\Models\OddsDc; use App\Utilities\Margin; use App\Utilities\Notice; @@ -12,10 +12,10 @@ class _Dc { public static function grap($odds, $offer) { - $debug = NuhBash::$options['d'] ?? 0; + $debug = Nuh::$options['d'] ?? 0; if ($debug) { - Notice::note('Double Chance '.NuhBash::$bookmaker_id, 'b'); + Notice::note('Double Chance '.Nuh::$bookmaker_id, 'b'); } $update_array = []; @@ -30,14 +30,14 @@ class _Dc $update_array['sport_id'] = $odds['sport_id']; $update_array['offer_id'] = $odds['offer_id']; $update_array['flag'] = 1; - $update_array['provider_id'] = $odds['provider_id']; + $update_array['provider_id'] = Nuh::$options['provider_id']; $update_array['nuh_check'] = 0; $update_array['last_check_at'] = Carbon::now()->toDateTimeString(); $update_array['source_updated_at'] = $odds['source_updated_at']; OddsDc::updateOrCreate([ - 'event_id' => NuhBash::$_event->id, - 'bookmaker_id' => NuhBash::$bookmaker_id, + 'event_id' => Nuh::$_event->id, + 'bookmaker_id' => Nuh::$bookmaker_id, ], $update_array); } } diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_Dnb.php b/app/Console/Commands/Grapper/TxOdds/Odds/_Dnb.php index fafeec78..be253515 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_Dnb.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_Dnb.php @@ -2,7 +2,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; -use App\Console\Commands\NuhBash; +use App\Console\Commands\Nuh; use App\Models\OddsDnb; use App\Utilities\Margin; use App\Utilities\Notice; @@ -12,10 +12,10 @@ class _Dnb { public static function grap($odds, $offer) { - $debug = NuhBash::$options['d'] ?? 0; + $debug = Nuh::$options['d'] ?? 0; if ($debug) { - Notice::note('Draw No Bet '.NuhBash::$bookmaker_id, 'b'); + Notice::note('Draw No Bet '.Nuh::$bookmaker_id, 'b'); } $update_array = []; @@ -29,14 +29,14 @@ class _Dnb $update_array['sport_id'] = $odds['sport_id']; $update_array['offer_id'] = $odds['offer_id']; $update_array['flag'] = 1; - $update_array['provider_id'] = $odds['provider_id']; + $update_array['provider_id'] = Nuh::$options['provider_id']; $update_array['nuh_check'] = 0; $update_array['last_check_at'] = Carbon::now()->toDateTimeString(); $update_array['source_updated_at'] = $odds['source_updated_at']; OddsDnb::updateOrCreate([ - 'event_id' => NuhBash::$_event->id, - 'bookmaker_id' => NuhBash::$bookmaker_id, + 'event_id' => Nuh::$_event->id, + 'bookmaker_id' => Nuh::$bookmaker_id, ], $update_array); } } diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_Ggng.php b/app/Console/Commands/Grapper/TxOdds/Odds/_Ggng.php index a9d840b3..41d1da1a 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_Ggng.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_Ggng.php @@ -2,7 +2,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; -use App\Console\Commands\NuhBash; +use App\Console\Commands\Nuh; use App\Models\OddsGgng; use App\Utilities\Margin; use App\Utilities\Notice; @@ -12,10 +12,10 @@ class _Ggng { public static function grap($odds, $offer) { - $debug = NuhBash::$options['d'] ?? 0; + $debug = Nuh::$options['d'] ?? 0; if ($debug) { - Notice::note('Goal No Goal '.NuhBash::$bookmaker_id, 'b'); + Notice::note('Goal No Goal '.Nuh::$bookmaker_id, 'b'); } $update_array = []; @@ -29,14 +29,14 @@ class _Ggng $update_array['sport_id'] = $odds['sport_id']; $update_array['offer_id'] = $odds['offer_id']; $update_array['flag'] = 1; - $update_array['provider_id'] = $odds['provider_id']; + $update_array['provider_id'] = Nuh::$options['provider_id']; $update_array['nuh_check'] = 0; $update_array['last_check_at'] = Carbon::now()->toDateTimeString(); $update_array['source_updated_at'] = $odds['source_updated_at']; OddsGgng::updateOrCreate([ - 'event_id' => NuhBash::$_event->id, - 'bookmaker_id' => NuhBash::$bookmaker_id, + 'event_id' => Nuh::$_event->id, + 'bookmaker_id' => Nuh::$bookmaker_id, ], $update_array); } } diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_Totals.php b/app/Console/Commands/Grapper/TxOdds/Odds/_Totals.php index e641b7bf..ea7b20c1 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_Totals.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_Totals.php @@ -2,7 +2,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; -use App\Console\Commands\NuhBash; +use App\Console\Commands\Nuh; use App\Models\OddsTotal; use App\Utilities\Margin; use App\Utilities\Notice; @@ -12,10 +12,10 @@ class _Totals { public static function grap($odds, $offer) { - $debug = NuhBash::$options['d'] ?? 0; + $debug = Nuh::$options['d'] ?? 0; if ($debug) { - Notice::note('Totals '.NuhBash::$bookmaker_id, 'b'); + Notice::note('Totals '.Nuh::$bookmaker_id, 'b'); } $update_array = []; @@ -38,14 +38,14 @@ class _Totals $update_array['sport_id'] = $odds['sport_id']; $update_array['offer_id'] = $odds['offer_id']; $update_array['flag'] = 1; - $update_array['provider_id'] = $odds['provider_id']; + $update_array['provider_id'] = Nuh::$options['provider_id']; $update_array['nuh_check'] = 0; $update_array['last_check_at'] = Carbon::now()->toDateTimeString(); $update_array['source_updated_at'] = $odds['source_updated_at']; OddsTotal::updateOrCreate([ - 'event_id' => NuhBash::$_event->id, - 'bookmaker_id' => NuhBash::$bookmaker_id, + 'event_id' => Nuh::$_event->id, + 'bookmaker_id' => Nuh::$bookmaker_id, ], $update_array); } } diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_Tq.php b/app/Console/Commands/Grapper/TxOdds/Odds/_Tq.php index 8a0ab12e..d87169c0 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_Tq.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_Tq.php @@ -2,7 +2,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; -use App\Console\Commands\NuhBash; +use App\Console\Commands\Nuh; use App\Models\OddsQualify; use App\Utilities\Margin; use App\Utilities\Notice; @@ -12,10 +12,10 @@ class _Tq { public static function grap($odds, $offer) { - $debug = NuhBash::$options['d'] ?? 0; + $debug = Nuh::$options['d'] ?? 0; if ($debug) { - Notice::note('To Qualify '.NuhBash::$bookmaker_id, 'b'); + Notice::note('To Qualify '.Nuh::$bookmaker_id, 'b'); } $update_array = []; @@ -29,14 +29,14 @@ class _Tq $update_array['sport_id'] = $odds['sport_id']; $update_array['offer_id'] = $odds['offer_id']; $update_array['flag'] = 1; - $update_array['provider_id'] = $odds['provider_id']; + $update_array['provider_id'] = Nuh::$options['provider_id']; $update_array['nuh_check'] = 0; $update_array['last_check_at'] = Carbon::now()->toDateTimeString(); $update_array['source_updated_at'] = $odds['source_updated_at']; OddsQualify::updateOrCreate([ - 'event_id' => NuhBash::$_event->id, - 'bookmaker_id' => NuhBash::$bookmaker_id, + 'event_id' => Nuh::$_event->id, + 'bookmaker_id' => Nuh::$bookmaker_id, ], $update_array); } } diff --git a/app/Console/Commands/NuhBash.php b/app/Console/Commands/Nuh.php similarity index 83% rename from app/Console/Commands/NuhBash.php rename to app/Console/Commands/Nuh.php index 0a726166..ea78ce6b 100644 --- a/app/Console/Commands/NuhBash.php +++ b/app/Console/Commands/Nuh.php @@ -2,14 +2,15 @@ namespace App\Console\Commands; -use App\Console\Commands\Grapper\TxSwitch; +use App\Console\Commands\Grapper\Magloo; +use App\Console\Commands\Grapper\TxOdds; use App\Models\Supervisor; use App\Utilities\Notice; use App\Utilities\Supervisorctl; use Illuminate\Console\Command; use Illuminate\Support\Facades\DB; -class NuhBash extends Command +class Nuh extends Command { public static $options = []; @@ -25,7 +26,7 @@ class NuhBash extends Command protected $signature = 'nuh {process=help} {eventid=0} {--d} {--f} {--a} {--w} {--p} {--s} {--r} {--b} {--q}'; - protected $description = 'NuhBash'; + protected $description = 'Nuh'; public function handle() { @@ -49,7 +50,8 @@ class NuhBash extends Command $txt .= '--f force update market'.PHP_EOL; $txt .= '--a reload all'.PHP_EOL; $txt .= '--w reload one week'.PHP_EOL; - $txt .= '--p print grapped file'.PHP_EOL; + $txt .= '--p use proydb1'.PHP_EOL; + $txt .= '--e echo file'.PHP_EOL; $txt .= '--s store data to file '.PHP_EOL; $txt .= '--r read data from file '.PHP_EOL; $txt .= '--b break loop after one '.PHP_EOL; @@ -75,13 +77,23 @@ class NuhBash extends Command switch (self::$options['provider_id']) { case 1: - // direct - break; + TxOdds::switch(); case 2: - TxSwitch::switch(); - case 3: // betsapi break; + case 3: + // MAGLOO KENIA + break; + case 4: + // MAGLOO NIGERIA + Magloo::switch(); + break; + case 5: + // LOGIFUTUR NIGERA + break; + case 6: + // LOGIFUTUR COLOMBIA + break; default: Notice::note('Provider not defined', 'r', 1); break; diff --git a/app/Console/Commands/Xml.php b/app/Console/Commands/Xml.php index a4064126..1395c61f 100644 --- a/app/Console/Commands/Xml.php +++ b/app/Console/Commands/Xml.php @@ -10,11 +10,11 @@ class Xml public static function load($url) { - $debug = NuhBash::$options['d'] ?? 0; - $save = NuhBash::$options['s'] ?? 0; - $read = NuhBash::$options['r'] ?? 0; + $debug = Nuh::$options['d'] ?? 0; + $save = Nuh::$options['s'] ?? 0; + $read = Nuh::$options['r'] ?? 0; - $filename = app_path().'/Console/Commands/TestFiles/'.strtolower(str_replace(' ', '_', NuhBash::$options['name'])).'.xml'; + $filename = app_path().'/Console/Commands/TestFiles/'.strtolower(str_replace(' ', '_', Nuh::$options['name'])).'.xml'; if ($debug) { Notice::note("Loading URL\n".$url); diff --git a/app/Models/Sport.php b/app/Models/Sport.php index b11573a6..f4e5eff8 100644 --- a/app/Models/Sport.php +++ b/app/Models/Sport.php @@ -2,9 +2,17 @@ namespace App\Models; +use App\Utilities\Notice; use Illuminate\Database\Eloquent\Model; class Sport extends Model { - // + public static function map($field) + { + if (! in_array($field, ['bapi', 'bwin', 'b365', 'logi', 'magl'])) { + Notice::note('Wrong Option! Possible options: bapi, bwin, b365, logi, magl', 'r', 1); + } + + return Sport::select($field, 'id')->where('is_active', 1)->get()->useKey('id')->toArray(); + } } diff --git a/database/migrations/2025_05_17_074558_create_providers_table.php b/database/migrations/2025_05_17_074558_create_providers_table.php index be522d94..2cb6f5d3 100644 --- a/database/migrations/2025_05_17_074558_create_providers_table.php +++ b/database/migrations/2025_05_17_074558_create_providers_table.php @@ -14,7 +14,6 @@ return new class extends Migration Schema::create('providers', function (Blueprint $table) { $table->id(); $table->string('name'); - $table->timestamps(); }); } diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index a7990622..140965b1 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -21,7 +21,6 @@ class DatabaseSeeder extends Seeder SupervisorSeeder::class, BettypeSeeder::class, MultilineSettingSeeder::class, - MultilineClientsSeeder::class, ]); } } diff --git a/database/seeders/ProvoiderSeeder.php b/database/seeders/ProvoiderSeeder.php index 1656e8d2..4a9f525b 100644 --- a/database/seeders/ProvoiderSeeder.php +++ b/database/seeders/ProvoiderSeeder.php @@ -12,15 +12,14 @@ class ProvoiderSeeder extends Seeder /** * Provoider */ - $sql = "INSERT INTO `providers` (`id`, `name`, `created_at`, `updated_at`) + $sql = "INSERT INTO `providers` (`id`, `name`) VALUES - ('1', 'DIRECT', NULL, NULL), - ('2', 'TXODDS', NULL, NULL), - ('3', 'BETSAPI', NULL, NULL), - ('4', 'MAGLOO KENIA', NULL, NULL), - ('5', 'MAGLOO NIGERIA', NULL, NULL), - ('6', 'LOGIFUTUR NIGERA', NULL, NULL), - ('7', 'LOGIFUTUR COLOMBIA', NULL, NULL); + ('1', 'TXODDS'), + ('2', 'BETSAPI'), + ('3', 'MAGLOO KENIA'), + ('4', 'MAGLOO NIGERIA'), + ('5', 'LOGIFUTUR NIGERA'), + ('6', 'LOGIFUTUR COLOMBIA'); "; DB::unprepared($sql); diff --git a/database/seeders/SupervisorSeeder.php b/database/seeders/SupervisorSeeder.php index 8286cfcf..face7c50 100644 --- a/database/seeders/SupervisorSeeder.php +++ b/database/seeders/SupervisorSeeder.php @@ -14,8 +14,9 @@ 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', '2', '1', '10', '0', NULL, '1800', '0', '1', '1', '2025-08-27 07:39:55', '2025-12-01 05:07:21'), - ('2', 'Odds', '2', '1', '10', '0', NULL, '30', '0', '0', '1', '2025-12-01 05:41:02', '2025-12-01 05:41:02'); + (1, 'Fixtures', 1, 1, 10, 0, '0.011', 1800, 0, 1, 1, '2025-08-27 07:39:55', '2025-12-18 11:45:11'), + (2, 'Odds', 1, 1, 10, 0, '0.016', 30, 0, 0, 1, '2025-12-01 05:41:02', '2025-12-18 11:51:54'), + (3, 'Magloo Nigeria Soccer', 4, 1, 10, 0, '0.001', 30, 0, 0, 1, '2025-12-18 17:44:33', '2025-12-18 17:46:31'); "; DB::unprepared($sql);