logifurture wip
This commit is contained in:
1 parent
99b901009c
commit
a96abae35a
15 files changed
+2143
-1518
No files matched your search
@@ -8,7 +8,7 @@ class Curl
|
||||
{
|
||||
public static $testfiles = '/Console/Commands/TestFiles/';
|
||||
|
||||
public static function load($url)
|
||||
public static function load($url, $_config = [])
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
$save = Nuh::$options['s'] ?? 0;
|
||||
@@ -30,6 +30,17 @@ class Curl
|
||||
return json_decode($file, true);
|
||||
}
|
||||
|
||||
// POST
|
||||
if (isset($_config['post'])) {
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($_config['post']));
|
||||
}
|
||||
|
||||
// JSON
|
||||
if (isset($_config['header'])) {
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $_config['header']);
|
||||
}
|
||||
|
||||
if ($proxy) {
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, Nuh::$options['proxy']);
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper;
|
||||
|
||||
use App\Console\Commands\Grapper\Logifuture\Auth;
|
||||
use App\Console\Commands\Grapper\Logifuture\BaseUrl;
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Models\Sport;
|
||||
use App\Utilities\Notice;
|
||||
|
||||
class Logifuture
|
||||
{
|
||||
public static function switch()
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
$proxy = Nuh::$options['p'] ?? 0;
|
||||
|
||||
$sportmap = Sport::map('logi', 1, [1, 2, 3, 5]);
|
||||
|
||||
dd($sportmap);
|
||||
|
||||
if ($debug) {
|
||||
Notice::note(Nuh::$options['provider']['name'].' '.Nuh::$options['sport']['name'], 'g');
|
||||
}
|
||||
|
||||
switch (Nuh::$options['provider_id']) {
|
||||
case 5:
|
||||
Nuh::$options['bookmaker_id'] = 35;
|
||||
break;
|
||||
case 6:
|
||||
Nuh::$options['bookmaker_id'] = 36;
|
||||
break;
|
||||
}
|
||||
|
||||
$base_url = BaseUrl::get();
|
||||
|
||||
$header = Auth::exe();
|
||||
|
||||
foreach ($sportmap as $client_sportid => $sportid) {
|
||||
|
||||
$url = $base_url.'/v1/matches?sportId='.$client_sportid;
|
||||
|
||||
$data = Loader::curlLoader($url, ['curl_options' => $header]);
|
||||
|
||||
dd($data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\Logifuture;
|
||||
|
||||
class Auth
|
||||
{
|
||||
public static $pass = 'nuhodds';
|
||||
|
||||
public static function exe()
|
||||
{
|
||||
$base_url = BaseUrl::get();
|
||||
|
||||
$url = $base_url.'/v1/authentication/token';
|
||||
|
||||
$data = Loader::curlLoader($url, [
|
||||
'header' => [
|
||||
'accept: application/json',
|
||||
'content-type: application/json',
|
||||
],
|
||||
'post' => [
|
||||
'username' => 'nuhodds',
|
||||
'password' => self::$pass,
|
||||
],
|
||||
]);
|
||||
|
||||
if (! is_array($data)) {
|
||||
|
||||
Notice::note('no data sleep(60)', 'r');
|
||||
sleep(60);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$header = $data;
|
||||
$header[] = 'Authorization: Bearer '.$data['token'];
|
||||
$header[] = 'accept: application/json';
|
||||
$header[] = 'content-type: application/json';
|
||||
|
||||
return $header;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\Logifuture;
|
||||
|
||||
use App\Console\Commands\Nuh;
|
||||
|
||||
class BaseUrl
|
||||
{
|
||||
public static function get()
|
||||
{
|
||||
$test = Nuh::$options['t'] ?? 0;
|
||||
|
||||
switch (Nuh::$options['provider_id']) {
|
||||
case 5:
|
||||
if ($test) {
|
||||
$base_url = 'https://stg-external-api.bet9ja.com/external';
|
||||
} else {
|
||||
$base_url = 'https://external-api.bet9ja.com/external';
|
||||
}
|
||||
|
||||
break;
|
||||
case 6:
|
||||
if ($test) {
|
||||
$base_url = 'https://stg-external-api.yajuego.co/external';
|
||||
} else {
|
||||
$base_url = 'https://external-api.yajuego.co/external';
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return $base_url;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\Logifuture;
|
||||
|
||||
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;
|
||||
$proxy = Nuh::$options['p'] ?? 0;
|
||||
|
||||
$sportmap = Sport::map('logi', 1, [1, 3]);
|
||||
|
||||
dd($sportmap);
|
||||
|
||||
self::$elements = LoadElements::load(Nuh::$options['provider_id']);
|
||||
|
||||
self::$groups = LoadGroups::load(Nuh::$options['provider_id']);
|
||||
|
||||
if ($proxy) {
|
||||
Notice::note('PROXY USED', 'r');
|
||||
}
|
||||
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\Logifuture;
|
||||
|
||||
use App\Console\Commands\Curl;
|
||||
use App\Console\Commands\Grapper\Magloo\Odds\FilterHandicap;
|
||||
use App\Console\Commands\Grapper\Magloo\Odds\FilterTotals;
|
||||
use App\Console\Commands\Grapper\Magloo\Odds\FilterTotalsQ1;
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Models\Event;
|
||||
use App\Models\EventBookmaker;
|
||||
use App\Models\Odds3way;
|
||||
use App\Models\OddsDc;
|
||||
use App\Models\OddsHandicap;
|
||||
use App\Models\OddsHandicapQ1;
|
||||
use App\Models\OddsTotal;
|
||||
use App\Models\OddsTotalQ1;
|
||||
use App\Models\OddsTq;
|
||||
use App\Models\Sport;
|
||||
use App\Utilities\Margin;
|
||||
use App\Utilities\Notice;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class Odds
|
||||
{
|
||||
public static function grap()
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
$proxy = Nuh::$options['p'] ?? 0;
|
||||
|
||||
$event_id_collector = [];
|
||||
|
||||
$sportmap = Sport::map('magl', 1, [1, 3]);
|
||||
|
||||
if ($proxy) {
|
||||
Notice::note('PROXY USED', 'r');
|
||||
}
|
||||
|
||||
if ($debug) {
|
||||
Notice::note('ODDS '.Nuh::$options['process'], 'b');
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
foreach ($sportmap as $magloo_sport_id => $sport_id) {
|
||||
$url = $base_url.$magloo_sport_id.'/odds';
|
||||
|
||||
$data = Curl::load($url);
|
||||
if (! is_array($data) or \count($data) == 0) {
|
||||
Notice::note('no data in feed', 'r', 1);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($data as $match) {
|
||||
|
||||
$betradar_id = (int) preg_replace('/\D/', '', $match['p']);
|
||||
|
||||
$starttime = Carbon::parse($match['dt'])->toDateTimeString();
|
||||
|
||||
$event_id = Event::where('betradar_id', $betradar_id)->value('id');
|
||||
|
||||
if ($event_id) {
|
||||
$base = [];
|
||||
$base['sport_id'] = $sport_id;
|
||||
$base['provider_id'] = Nuh::$options['provider_id'];
|
||||
$base['bmoid'] = preg_replace('/\D/', '', $match['i']);
|
||||
$base['flag'] = 1;
|
||||
|
||||
$event_id_collector[] = $event_id;
|
||||
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], ['in_feed' => 1, 'bmoid' => $base['bmoid']]);
|
||||
|
||||
foreach ($match['M'] as $magloo_bettype_id => $value) {
|
||||
switch ($magloo_bettype_id) {
|
||||
case 1:
|
||||
// 1x2
|
||||
$odds = [];
|
||||
$odds['h3w'] = $value['static'][1] ?? 1;
|
||||
$odds['d3w'] = $value['static'][2] ?? 1;
|
||||
$odds['a3w'] = $value['static'][3] ?? 1;
|
||||
$odds['margin'] = (float) Margin::calculate($odds, 1);
|
||||
$odds['starttime'] = $starttime;
|
||||
|
||||
Odds3way::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], $base + $odds);
|
||||
|
||||
break;
|
||||
case 2:
|
||||
// to qalify
|
||||
$odds = [];
|
||||
$odds['htq'] = $value['static'][4] ?? 1;
|
||||
$odds['atq'] = $value['static'][5] ?? 1;
|
||||
$odds['margin'] = (float) Margin::calculate($odds, 1);
|
||||
|
||||
OddsTq::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], $base + $odds);
|
||||
|
||||
break;
|
||||
|
||||
case 10:
|
||||
// double chance
|
||||
$odds = [];
|
||||
$odds['dc1x'] = $value['static'][9] ?? 1;
|
||||
$odds['dc12'] = $value['static'][10] ?? 1;
|
||||
$odds['dcx2'] = $value['static'][11] ?? 1;
|
||||
$odds['margin'] = (float) Margin::calculate($odds, 1);
|
||||
|
||||
OddsDc::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], $base + $odds);
|
||||
|
||||
break;
|
||||
|
||||
case 10:
|
||||
// ggng
|
||||
$odds = [];
|
||||
$odds['gg'] = $value['static'][74] ?? 1;
|
||||
$odds['ng'] = $value['static'][76] ?? 1;
|
||||
$odds['margin'] = (float) Margin::calculate($odds, 1);
|
||||
|
||||
OddsDc::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], $base + $odds);
|
||||
|
||||
break;
|
||||
|
||||
case 16:
|
||||
// points
|
||||
$odds = FilterHandicap::get($value);
|
||||
$odds['starttime'] = $starttime;
|
||||
|
||||
OddsHandicap::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], $base + $odds);
|
||||
break;
|
||||
|
||||
case 2000:
|
||||
// points qt
|
||||
$odds = FilterHandicap::get($value);
|
||||
OddsHandicap::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], $base + $odds);
|
||||
break;
|
||||
|
||||
case 2025:
|
||||
// points qt
|
||||
$odds = FilterHandicapQ1::get($value);
|
||||
OddsHandicapQ1::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], $base + $odds);
|
||||
break;
|
||||
case 17:
|
||||
case 2002:
|
||||
// totals
|
||||
$odds = FilterTotals::get($value, $sport_id);
|
||||
OddsTotal::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], $base + $odds);
|
||||
break;
|
||||
case 2012:
|
||||
// totals qt
|
||||
$odds = FilterTotalsQ1::get($value, $sport_id);
|
||||
OddsTotalQ1::updateOrCreate([
|
||||
'event_id' => $event_id,
|
||||
'bookmaker_id' => $bookmaker_id,
|
||||
], $base + $odds);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EventBookmaker::whereNotIn('event_id', $event_id_collector)
|
||||
->where('bookmaker_id', $bookmaker_id)
|
||||
->update(['in_feed' => 0]);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,9 @@ class Fixtures
|
||||
}
|
||||
|
||||
foreach ($data as $row) {
|
||||
|
||||
dd($row);
|
||||
|
||||
$event = [
|
||||
'provider_id' => (int) Nuh::$options['provider_id'],
|
||||
'starttime' => Carbon::createFromDate((string) $row->time)->toDateTimeString(),
|
||||
|
||||
@@ -127,6 +127,12 @@ class Odds
|
||||
foreach ($res as $id) {
|
||||
$_calls[] = $url."&ot=$markets&peid=".$id;
|
||||
}
|
||||
} elseif (Nuh::$options['g']) {
|
||||
// by groups
|
||||
$res = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDays(1)->toDateTimeString())->groupBy('group_id')->pluck('group_id');
|
||||
foreach ($res as $id) {
|
||||
$_calls[] = $url."&ot=$markets&pgid=".$id;
|
||||
}
|
||||
} elseif (Nuh::$options['b']) {
|
||||
// one day
|
||||
$res = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDays(1)->toDateTimeString())->pluck('id');
|
||||
@@ -150,6 +156,8 @@ class Odds
|
||||
$counter = 0;
|
||||
foreach ($_calls as $url) {
|
||||
|
||||
$counter++;
|
||||
|
||||
$data = Xml::load($url);
|
||||
|
||||
if ($echo) {
|
||||
@@ -203,8 +211,6 @@ class Odds
|
||||
];
|
||||
Element::updateOrCreate(['id' => (int) $row->ateam['id']], $element);
|
||||
|
||||
$counter++;
|
||||
|
||||
foreach ($row->bookmaker as $book) {
|
||||
|
||||
Nuh::$id = (int) $row['id'];
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\Commands\Grapper\Betsapi;
|
||||
use App\Console\Commands\Grapper\Logifuture;
|
||||
use App\Console\Commands\Grapper\Magloo;
|
||||
use App\Console\Commands\Grapper\TxOdds;
|
||||
use App\Models\Supervisor;
|
||||
@@ -23,7 +24,7 @@ class Nuh extends Command
|
||||
|
||||
public static $BETSAPI_TOKEN = '36152-aeTRNnZxSPUwGe';
|
||||
|
||||
protected $signature = 'nuh {process=help} {eventid=0} {--d} {--f} {--a} {--w} {--p} {--e} {--s} {--r} {--b} {--q} {--t}';
|
||||
protected $signature = 'nuh {process=help} {eventid=0} {--d} {--f} {--a} {--w} {--p} {--e} {--s} {--r} {--b} {--q} {--t} {--g}';
|
||||
|
||||
protected $description = 'Nuh';
|
||||
|
||||
@@ -45,7 +46,9 @@ class Nuh extends Command
|
||||
$txt .= 'List of options'.PHP_EOL;
|
||||
$txt .= '----------------------------------------------'.PHP_EOL;
|
||||
$txt .= '--a reload all'.PHP_EOL;
|
||||
$txt .= '--b break loop after one '.PHP_EOL;
|
||||
$txt .= '--b load one day single '.PHP_EOL;
|
||||
$txt .= '--w laod one week (tx)'.PHP_EOL;
|
||||
$txt .= '--g by minor groups (tx)'.PHP_EOL;
|
||||
|
||||
$txt .= '--d debug'.PHP_EOL;
|
||||
$txt .= '--e echo file'.PHP_EOL;
|
||||
@@ -57,14 +60,17 @@ class Nuh extends Command
|
||||
|
||||
$txt .= '--s store data to file '.PHP_EOL;
|
||||
$txt .= '--t test server url '.PHP_EOL;
|
||||
$txt .= '--w reload one week (tx)'.PHP_EOL;
|
||||
|
||||
$txt .= '----------------------------------------------'.PHP_EOL.PHP_EOL;
|
||||
$txt .= 'List of supervisors'.PHP_EOL;
|
||||
$txt .= '----------------------------------------------'.PHP_EOL;
|
||||
$tmp = Supervisor::all();
|
||||
$tmp = Supervisor::orderBy('provider_id')->get();
|
||||
foreach ($tmp as $value) {
|
||||
$txt .= sprintf('% 3d', $value->id).' '.$value->provider->name.' - '.$value->type.' '.$value->name.PHP_EOL;
|
||||
if ($value->sport_id) {
|
||||
$txt .= sprintf('% 3d', $value->id).' '.$value->provider->name.' - '.$value->sport->name.' '.$value->name.PHP_EOL;
|
||||
} else {
|
||||
$txt .= sprintf('% 3d', $value->id).' '.$value->provider->name.' - All '.$value->name.PHP_EOL;
|
||||
}
|
||||
}
|
||||
Notice::note($txt, 'b', 1);
|
||||
}
|
||||
@@ -96,9 +102,11 @@ class Nuh extends Command
|
||||
break;
|
||||
case 5:
|
||||
// LOGIFUTUR NIGERA
|
||||
Logifuture::switch();
|
||||
break;
|
||||
case 6:
|
||||
// LOGIFUTUR COLOMBIA
|
||||
Logifuture::switch();
|
||||
break;
|
||||
default:
|
||||
Notice::note('Provider not defined', 'r', 1);
|
||||
|
||||
+1643
-1498
File diff suppressed because it is too large.
Load diff
@@ -3,40 +3,44 @@
|
||||
namespace App\Mapper;
|
||||
|
||||
use App\Models\Event;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class LoadEvents
|
||||
{
|
||||
public static function load()
|
||||
{
|
||||
|
||||
$query = Event::query()->where('sport_id', Auth::user()->sport_id)->where('starttime', '>', Carbon::now());
|
||||
|
||||
switch (Auth::user()->provider_id) {
|
||||
case 2:
|
||||
// BETSAPI
|
||||
return Event::query()->where('sport_id', Auth::user()->sport_id)->where('betsapi_id', 0);
|
||||
return $query->where('betsapi_id', 0);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
// Magloo Kenia
|
||||
return Event::query()->where('sport_id', Auth::user()->sport_id)->where('magken_id', 0);
|
||||
return $query->where('magken_id', 0);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
// Magloo Nigeria
|
||||
return Event::query()->where('sport_id', Auth::user()->sport_id)->where('magnig_id', 0);
|
||||
return $query->where('magnig_id', 0);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
// Logifuture Nigeria
|
||||
return Event::query()->where('sport_id', Auth::user()->sport_id)->where('lognig_id', 0);
|
||||
return $query->where('lognig_id', 0);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
// Magloo Colombia
|
||||
return Event::query()->where('sport_id', Auth::user()->sport_id)->where('logcol_id', 0);
|
||||
return $query->where('logcol_id', 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
return Event::query()->where('sport_id', Auth::user()->sport_id)->where('betradar_id', 0);
|
||||
return $query->where('betradar_id', 0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,16 @@
|
||||
namespace App\Mapper;
|
||||
|
||||
use App\Models\Mapper;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class LoadProvider
|
||||
{
|
||||
public static function load()
|
||||
{
|
||||
return Mapper::query()->where('sport_id', Auth::user()->sport_id)->where('provider_id', Auth::user()->provider_id);
|
||||
return Mapper::query()
|
||||
->where('sport_id', Auth::user()->sport_id)
|
||||
->where('starttime', '>', Carbon::now())
|
||||
->where('provider_id', Auth::user()->provider_id);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Utilities;
|
||||
|
||||
use App\Models\Provider;
|
||||
use App\Models\Supervisor;
|
||||
|
||||
class Supervisorctl
|
||||
@@ -23,7 +22,7 @@ class Supervisorctl
|
||||
|
||||
self::$code = $options['supervisor_id'];
|
||||
|
||||
$supervisor = Supervisor::find(self::$code);
|
||||
$supervisor = Supervisor::with('sport')->with('provider')->find(self::$code);
|
||||
|
||||
if ($supervisor) {
|
||||
if ($debug) {
|
||||
@@ -31,7 +30,6 @@ 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';
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ return new class extends Migration
|
||||
$table->dateTime('starttime')->nullable();
|
||||
$table->integer('sport_id')->index()->references('id')->on('sports');
|
||||
$table->integer('country_id')->default(0)->nullable()->index()->references('id')->on('countries');
|
||||
$table->integer('group_id')->default(0)->nullable()->index()->references('id')->on('groups');
|
||||
$table->integer('group_id')->default(0)->nullable()->index();
|
||||
$table->integer('competition_group_id')->default(0)->nullable()->index()->references('id')->on('competition_groups');
|
||||
$table->integer('home_id')->default(0)->nullable()->index()->references('id')->on('elements');
|
||||
$table->integer('away_id')->default(0)->nullable()->index()->references('id')->on('elements');
|
||||
|
||||
@@ -24,7 +24,15 @@ class SupervisorSeeder extends Seeder
|
||||
(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', 4, 0, 15, 0, NULL, 1800, 0, 0, 1, '2026-01-03 12:27:44', '2026-01-03 12:27:53'),
|
||||
(10, 'Fixtures', 3, 0, 10, 0, '1.368', 30, 0, 1, 1, '2025-12-18 17:44:33', '2026-01-03 12:24:52'),
|
||||
(11, 'Odds', 3, 0, 15, 0, NULL, 1800, 0, 0, 1, '2026-01-03 12:27:44', '2026-01-03 12:27:53');
|
||||
(11, 'Odds', 3, 0, 15, 0, NULL, 1800, 0, 0, 1, '2026-01-03 12:27:44', '2026-01-03 12:27:53'),
|
||||
(12, 'Odds', 5, 1, 10, 0, '1.368', 30, 0, 0, 1, '2025-12-18 17:44:33', '2026-01-05 06:22:27'),
|
||||
(13, 'Odds', 5, 3, 15, 0, NULL, 1800, 0, 0, 1, '2026-01-03 12:27:44', '2026-01-05 06:22:37'),
|
||||
(14, 'Odds', 5, 2, 10, 0, '1.368', 30, 0, 0, 1, '2025-12-18 17:44:33', '2026-01-05 06:22:51'),
|
||||
(15, 'Odds', 5, 5, 15, 0, NULL, 1800, 0, 0, 1, '2026-01-03 12:27:44', '2026-01-03 12:27:53'),
|
||||
(16, 'Odds', 6, 1, 10, 0, '1.368', 30, 0, 0, 1, '2025-12-18 17:44:33', '2026-01-05 06:22:27'),
|
||||
(17, 'Odds', 6, 3, 15, 0, NULL, 1800, 0, 0, 1, '2026-01-03 12:27:44', '2026-01-05 06:22:37'),
|
||||
(18, 'Odds', 6, 2, 10, 0, '1.368', 30, 0, 0, 1, '2025-12-18 17:44:33', '2026-01-05 06:22:51'),
|
||||
(19, 'Odds', 6, 5, 15, 0, NULL, 1800, 0, 0, 1, '2026-01-03 12:27:44', '2026-01-03 12:27:53');
|
||||
";
|
||||
DB::unprepared($sql);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user