set base_url in provider table
This commit is contained in:
1 parent
5895f90b5b
commit
f68fdc1dec
10 files changed
+77
-111
No files matched your search
@@ -25,23 +25,12 @@ class Logifuture
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
switch (Nuh::$options['provider_id']) {
|
||||
case 5:
|
||||
Nuh::$options['bookmaker_id'] = 35;
|
||||
self::$base_url = 'https://external-api.bet9ja.com/external';
|
||||
break;
|
||||
case 6:
|
||||
Nuh::$options['bookmaker_id'] = 36;
|
||||
self::$base_url = 'https://external-api.yajuego.co/external';
|
||||
break;
|
||||
}
|
||||
|
||||
$sportmap = Sport::map('logi', 1, [1, 2, 3, 5]);
|
||||
|
||||
$event_id_collector = [];
|
||||
|
||||
if ($debug) {
|
||||
Notice::note(Nuh::$options['provider']['name'].' '.Nuh::$options['sport']['name'], 'g');
|
||||
Notice::note(Nuh::$options['provider'].' '.Nuh::$options['sport'], 'g');
|
||||
}
|
||||
|
||||
Authentication::authenticate();
|
||||
|
||||
@@ -12,7 +12,7 @@ class Authentication
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
$url = Logifuture::$base_url.'/v1/authentication/token';
|
||||
$url = Nuh::$options['base_url'].'/v1/authentication/token';
|
||||
|
||||
if (config('env.app_env') == 'local') {
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class LogifutureData
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
$url = Logifuture::$base_url.'/v1/matches?sportId='.$logifuture_sport_id;
|
||||
$url = Nuh::$options['base_url'].'/v1/matches?sportId='.$logifuture_sport_id;
|
||||
|
||||
if (config('env.app_env') == 'local') {
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ namespace App\Console\Commands\Grapper\Magloo;
|
||||
|
||||
use App\Console\Commands\Curl;
|
||||
use App\Console\Commands\Grapper\Fixtures\FindFixture;
|
||||
use App\Console\Commands\Grapper\Magloo\Odds\BaseUrl;
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Models\EventBookmaker;
|
||||
use App\Models\Sport;
|
||||
use App\Utilities\Notice;
|
||||
use Illuminate\Support\Carbon;
|
||||
@@ -29,15 +29,13 @@ class Fixtures
|
||||
}
|
||||
|
||||
if ($debug) {
|
||||
Notice::note(Nuh::$options['provider']['name'].' '.Nuh::$options['name'], 'g');
|
||||
Notice::note(Nuh::$options['provider'].' '.Nuh::$options['name'], 'g');
|
||||
}
|
||||
|
||||
$base_url = BaseUrl::get();
|
||||
|
||||
/**
|
||||
* Tornaments
|
||||
*/
|
||||
$url = $base_url.'/sport';
|
||||
$url = Nuh::$options['base_url'].'/en/1/prematch/sport';
|
||||
|
||||
$data = Curl::load($url);
|
||||
|
||||
@@ -72,7 +70,7 @@ class Fixtures
|
||||
|
||||
$sport_id = $liga['sport_id'];
|
||||
|
||||
$url = $base_url.'/tournament/'.$liga['group_id'].'/event';
|
||||
$url = Nuh::$options['base_url'].'/en/1/prematch/tournament/'.$liga['group_id'].'/event';
|
||||
|
||||
$data = Curl::load($url);
|
||||
|
||||
@@ -98,7 +96,7 @@ class Fixtures
|
||||
|
||||
FindFixture::find($event);
|
||||
|
||||
if ($event['id']) {
|
||||
if (isset($event['id'])) {
|
||||
|
||||
$event_id_collector[] = $event['id'];
|
||||
|
||||
|
||||
@@ -38,25 +38,12 @@ class Odds
|
||||
}
|
||||
|
||||
if ($debug) {
|
||||
Notice::note(Nuh::$options['provider']['name'].' '.Nuh::$options['name'], 'g');
|
||||
}
|
||||
|
||||
switch (Nuh::$options['provider_id']) {
|
||||
case 3:
|
||||
// KENIA
|
||||
$base_url = 'https://api.externalsvc.com/api/sb/affiliates/20/1/prematch/sport/';
|
||||
$bookmaker_id = 16;
|
||||
break;
|
||||
case 4:
|
||||
// NIGERIA
|
||||
$base_url = 'https://api.externalsvc.com/api/sb/affiliates/30/1/prematch/sport/';
|
||||
$bookmaker_id = 10;
|
||||
break;
|
||||
|
||||
Notice::note(Nuh::$options['provider'].' '.Nuh::$options['name'], 'g');
|
||||
}
|
||||
|
||||
foreach ($sportmap as $magloo_sport_id => $sport_id) {
|
||||
$url = $base_url.$magloo_sport_id.'/odds';
|
||||
|
||||
$url = Nuh::$options['base_url'].'/1/prematch/sport/'.$magloo_sport_id.'/odds';
|
||||
|
||||
$data = Curl::load($url);
|
||||
|
||||
@@ -85,7 +72,7 @@ class Odds
|
||||
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], ['in_feed' => 1, 'bmoid' => $base['bmoid']]);
|
||||
|
||||
// if ($event_id == 13913478) {
|
||||
@@ -105,7 +92,7 @@ class Odds
|
||||
|
||||
Odds3way::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], $base + $odds);
|
||||
|
||||
break;
|
||||
@@ -119,7 +106,7 @@ class Odds
|
||||
|
||||
OddsTq::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], $base + $odds);
|
||||
|
||||
break;
|
||||
@@ -134,7 +121,7 @@ class Odds
|
||||
|
||||
OddsDc::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], $base + $odds);
|
||||
|
||||
break;
|
||||
@@ -148,7 +135,7 @@ class Odds
|
||||
|
||||
OddsDc::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], $base + $odds);
|
||||
|
||||
break;
|
||||
@@ -161,7 +148,7 @@ class Odds
|
||||
|
||||
OddsPoint::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], $base + $odds);
|
||||
break;
|
||||
|
||||
@@ -170,7 +157,7 @@ class Odds
|
||||
$odds = FilterHandicapQ1::get($value);
|
||||
OddsPointQ1::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], $base + $odds);
|
||||
break;
|
||||
|
||||
@@ -183,7 +170,7 @@ class Odds
|
||||
}
|
||||
OddsTotal::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], $base + $odds);
|
||||
break;
|
||||
|
||||
@@ -192,7 +179,7 @@ class Odds
|
||||
$odds = FilterTotalsQ1::get($value, $sport_id);
|
||||
OddsTotalQ1::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], $base + $odds);
|
||||
break;
|
||||
}
|
||||
@@ -202,7 +189,7 @@ class Odds
|
||||
}
|
||||
|
||||
EventBookmaker::whereNotIn('event_id', $event_id_collector)
|
||||
->where('bookmaker_id', $bookmaker_id)
|
||||
->where('bookmaker_id', Nuh::$options['bookmaker_id'])
|
||||
->update(['in_feed' => 0]);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\Magloo\Odds;
|
||||
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Utilities\Notice;
|
||||
|
||||
class BaseUrl
|
||||
{
|
||||
public static function get()
|
||||
{
|
||||
$test = 0;
|
||||
|
||||
switch (Nuh::$options['provider_id']) {
|
||||
case 3:
|
||||
// KENIA
|
||||
if ($test) {
|
||||
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';
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
// NIGERIA
|
||||
if ($test) {
|
||||
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';
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Notice::note('process name does not exist', 'r', 1);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,19 @@ class Supervisorctl
|
||||
|
||||
self::$code = $options['supervisor_id'];
|
||||
|
||||
$supervisor = Supervisor::with('sport')->with('provider')->find(self::$code);
|
||||
$supervisor = Supervisor::with('sport')->with('provider')->find(self::$code)->toArray();
|
||||
|
||||
if (isset($supervisor['sport']['name'])) {
|
||||
$supervisor['sport'] = $supervisor['sport']['name'];
|
||||
}
|
||||
|
||||
if ($supervisor['provider']) {
|
||||
$supervisor['provider_id'] = $supervisor['provider']['id'];
|
||||
$supervisor['base_url'] = $supervisor['provider']['base_url'];
|
||||
$supervisor['provider'] = $supervisor['provider']['name'];
|
||||
}
|
||||
|
||||
$options = array_merge($options, $supervisor);
|
||||
|
||||
if ($maker) {
|
||||
SupervisorMaker::run($supervisor);
|
||||
@@ -36,9 +48,6 @@ class Supervisorctl
|
||||
Notice::note('supervisor start '.self::$code, 'g');
|
||||
}
|
||||
|
||||
$tmp = $supervisor->toArray();
|
||||
unset($tmp['id']);
|
||||
$options = array_merge($options, $tmp);
|
||||
if ($proxy) {
|
||||
$options['proxy'] = 'https://prox2.nuhodds.com/proxy.php';
|
||||
}
|
||||
@@ -48,19 +57,38 @@ class Supervisorctl
|
||||
sleep($options['sleep']);
|
||||
} else {
|
||||
if ($options['is_supervisor']) {
|
||||
Notice::note('cron process timings set in crontab', 'b');
|
||||
Notice::note('cron process', 'b');
|
||||
} else {
|
||||
Notice::note('in production process sleeps for '.$options['sleep'].'sec', 'b');
|
||||
Notice::note('production sleeps '.$options['sleep'].'sec', 'b');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch ($options['provider_id']) {
|
||||
case 3:
|
||||
// MAGLOO KENIA
|
||||
$options['bookmaker_id'] = 16;
|
||||
break;
|
||||
case 4:
|
||||
// MAGLOO NIGERIA
|
||||
$options['bookmaker_id'] = 10;
|
||||
break;
|
||||
case 5:
|
||||
// LOGIFUTURE NIGERA
|
||||
$options['bookmaker_id'] = 35;
|
||||
break;
|
||||
case 6:
|
||||
// LOGIFUTURE COLOMBIA
|
||||
$options['bookmaker_id'] = 36;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (! $options['is_active'] && ! $runanyway) {
|
||||
Notice::note('Process disabled, sleeps 2 min then exit', 'r');
|
||||
sleep(120);
|
||||
exit;
|
||||
}
|
||||
|
||||
} else {
|
||||
Notice::note('unknown supervisor: '.self::$code, 'r', 1);
|
||||
}
|
||||
|
||||
Generated
+9
-9
@@ -2953,16 +2953,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/prompts",
|
||||
"version": "v0.3.9",
|
||||
"version": "v0.3.10",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/prompts.git",
|
||||
"reference": "5c41bf0555b7cfefaad4e66d3046675829581ac4"
|
||||
"reference": "360ba095ef9f51017473505191fbd4ab73e1cab3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/prompts/zipball/5c41bf0555b7cfefaad4e66d3046675829581ac4",
|
||||
"reference": "5c41bf0555b7cfefaad4e66d3046675829581ac4",
|
||||
"url": "https://api.github.com/repos/laravel/prompts/zipball/360ba095ef9f51017473505191fbd4ab73e1cab3",
|
||||
"reference": "360ba095ef9f51017473505191fbd4ab73e1cab3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3006,9 +3006,9 @@
|
||||
"description": "Add beautiful and user-friendly forms to your command-line applications.",
|
||||
"support": {
|
||||
"issues": "https://github.com/laravel/prompts/issues",
|
||||
"source": "https://github.com/laravel/prompts/tree/v0.3.9"
|
||||
"source": "https://github.com/laravel/prompts/tree/v0.3.10"
|
||||
},
|
||||
"time": "2026-01-07T21:00:29+00:00"
|
||||
"time": "2026-01-13T20:29:29+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/serializable-closure",
|
||||
@@ -12815,12 +12815,12 @@
|
||||
],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": {},
|
||||
"stability-flags": [],
|
||||
"prefer-stable": true,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": "^8.3"
|
||||
},
|
||||
"platform-dev": {},
|
||||
"plugin-api-version": "2.9.0"
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "2.6.0"
|
||||
}
|
||||
@@ -14,6 +14,7 @@ return new class extends Migration
|
||||
Schema::create('providers', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('base_url');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -12,18 +12,18 @@ class ProvoiderSeeder extends Seeder
|
||||
/**
|
||||
* Provoider
|
||||
*/
|
||||
$sql = "INSERT INTO `providers` (`id`, `name`)
|
||||
$sql = "INSERT INTO `providers` (`id`, `name`, `base_url`)
|
||||
VALUES
|
||||
(1, 'TXODDS'),
|
||||
(2, 'BETSAPI'),
|
||||
(3, 'MAGLOO KENIA'),
|
||||
(4, 'MAGLOO NIGERIA'),
|
||||
(5, 'LOGIFUTURE NIGERA'),
|
||||
(6, 'LOGIFUTURE COLOMBIA'),
|
||||
(7, 'SERVICES'),
|
||||
(8, 'TXODDS MARKET'),
|
||||
(9, 'BETICA'),
|
||||
(10, 'GOLDBET');
|
||||
(1, 'TXODDS', ''),
|
||||
(2, 'BETSAPI', ''),
|
||||
(3, 'MAGLOO KENIA', 'https://api.externalsvc.com/api/sb/affiliates/30'),
|
||||
(4, 'MAGLOO NIGERIA', 'https://api.externalsvc.com/api/sb/affiliates/20'),
|
||||
(5, 'LOGIFUTURE NIGERA', 'https://external-api.bet9ja.com/external'),
|
||||
(6, 'LOGIFUTURE COLOMBIA', 'https://external-api.yajuego.co/external'),
|
||||
(7, 'SERVICES', ''),
|
||||
(8, 'TXODDS MARKET', ''),
|
||||
(9, 'BETICA', ''),
|
||||
(10, 'GOLDBET', '');
|
||||
";
|
||||
DB::unprepared($sql);
|
||||
|
||||
|
||||
Reference in new issue
Block a user