wip
This commit is contained in:
1 parent
60379bcab8
commit
5c9745b1da
19 files changed
+167
-105
No files matched your search
@@ -8,11 +8,11 @@ class Curl
|
|||||||
{
|
{
|
||||||
public static $file;
|
public static $file;
|
||||||
|
|
||||||
public static function load($url)
|
public static function load($url, $proxy = false)
|
||||||
{
|
{
|
||||||
$debug = NuhBash::$options['d'] ?? 0;
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
$save = NuhBash::$options['s'] ?? 0;
|
$save = Nuh::$options['s'] ?? 0;
|
||||||
$read = NuhBash::$options['r'] ?? 0;
|
$read = Nuh::$options['r'] ?? 0;
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note($url);
|
Notice::note($url);
|
||||||
@@ -22,7 +22,7 @@ class Curl
|
|||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note('READ LOCAL', 'r');
|
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);
|
$file = file_get_contents($filename);
|
||||||
|
|
||||||
@@ -34,6 +34,13 @@ class Curl
|
|||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
curl_setopt($ch, CURLOPT_FAILONERROR, 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);
|
$data = curl_exec($ch);
|
||||||
$curl_errorno = curl_errno($ch);
|
$curl_errorno = curl_errno($ch);
|
||||||
if ($curl_errorno) {
|
if ($curl_errorno) {
|
||||||
@@ -46,7 +53,7 @@ class Curl
|
|||||||
|
|
||||||
if ($save) {
|
if ($save) {
|
||||||
Notice::note('SAVED LOCAL', 'b');
|
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);
|
file_put_contents(self::$file, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands\Grapper;
|
||||||
|
|
||||||
|
use App\Console\Commands\Nuh;
|
||||||
|
use App\Models\Sport;
|
||||||
|
use App\Utilities\Notice;
|
||||||
|
|
||||||
|
class Magloo
|
||||||
|
{
|
||||||
|
public static function switch()
|
||||||
|
{
|
||||||
|
|
||||||
|
$sportmap = Sport::map('magl');
|
||||||
|
|
||||||
|
dd($sportmap);
|
||||||
|
|
||||||
|
switch (Nuh::$options['sport_id']) {
|
||||||
|
case 1:
|
||||||
|
Fixtures::grap();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Notice::note('prosses name does not exist', 'r', 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,20 +4,20 @@ namespace App\Console\Commands\Grapper;
|
|||||||
|
|
||||||
use App\Console\Commands\Grapper\TxOdds\Fixtures;
|
use App\Console\Commands\Grapper\TxOdds\Fixtures;
|
||||||
use App\Console\Commands\Grapper\TxOdds\Odds;
|
use App\Console\Commands\Grapper\TxOdds\Odds;
|
||||||
use App\Console\Commands\NuhBash;
|
use App\Console\Commands\Nuh;
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
|
|
||||||
class TxSwitch
|
class TxOdds
|
||||||
{
|
{
|
||||||
public static function switch()
|
public static function switch()
|
||||||
{
|
{
|
||||||
if (NuhBash::$options['sport_id'] == 1) {
|
if (Nuh::$options['sport_id'] == 1) {
|
||||||
NuhBash::$AUTHTOKEN = 'ident=betaid1&passwd=Dy59vpRC';
|
Nuh::$AUTHTOKEN = 'ident=betaid1&passwd=Dy59vpRC';
|
||||||
} else {
|
} else {
|
||||||
NuhBash::$AUTHTOKEN = 'ident=betaid2&passwd=Dy59vpRC';
|
Nuh::$AUTHTOKEN = 'ident=betaid2&passwd=Dy59vpRC';
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (NuhBash::$options['name']) {
|
switch (Nuh::$options['name']) {
|
||||||
case 'Fixtures':
|
case 'Fixtures':
|
||||||
Fixtures::grap();
|
Fixtures::grap();
|
||||||
break;
|
break;
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
namespace App\Console\Commands\Grapper\TxOdds;
|
namespace App\Console\Commands\Grapper\TxOdds;
|
||||||
|
|
||||||
use App\Console\Commands\Curl;
|
use App\Console\Commands\Curl;
|
||||||
use App\Console\Commands\NuhBash;
|
use App\Console\Commands\Nuh;
|
||||||
use App\Models\Country;
|
use App\Models\Country;
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
|
|
||||||
@@ -11,8 +11,8 @@ class Countries
|
|||||||
{
|
{
|
||||||
public static function call()
|
public static function call()
|
||||||
{
|
{
|
||||||
$debug = NuhBash::$options['d'] ?? 0;
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
$print = NuhBash::$options['p'] ?? 0;
|
$print = Nuh::$options['p'] ?? 0;
|
||||||
|
|
||||||
$url = 'https://xml2.txodds.com/feed/countries.php';
|
$url = 'https://xml2.txodds.com/feed/countries.php';
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands\Grapper\TxOdds;
|
namespace App\Console\Commands\Grapper\TxOdds;
|
||||||
|
|
||||||
use App\Console\Commands\NuhBash;
|
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;
|
||||||
@@ -15,9 +15,9 @@ class Fixtures
|
|||||||
{
|
{
|
||||||
public static function grap()
|
public static function grap()
|
||||||
{
|
{
|
||||||
$debug = NuhBash::$options['d'] ?? 0;
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
$print = NuhBash::$options['p'] ?? 0;
|
$echo = Nuh::$options['e'] ?? 0;
|
||||||
$break = NuhBash::$options['b'] ?? 0;
|
$break = Nuh::$options['b'] ?? 0;
|
||||||
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
$total = 0;
|
$total = 0;
|
||||||
@@ -40,11 +40,11 @@ class Fixtures
|
|||||||
$from = $now->addDays($i)->toDateString();
|
$from = $now->addDays($i)->toDateString();
|
||||||
$to = $now->addDays($i + 1)->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);
|
$data = Xml::load($url);
|
||||||
|
|
||||||
if ($print) {
|
if ($echo) {
|
||||||
dd($data);
|
dd($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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\_Ggng;
|
||||||
use App\Console\Commands\Grapper\TxOdds\Odds\_Totals;
|
use App\Console\Commands\Grapper\TxOdds\Odds\_Totals;
|
||||||
use App\Console\Commands\Grapper\TxOdds\Odds\_Tq;
|
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\Console\Commands\Xml;
|
||||||
use App\Models\CompetitionGroup;
|
use App\Models\CompetitionGroup;
|
||||||
use App\Models\Element;
|
use App\Models\Element;
|
||||||
@@ -23,10 +23,10 @@ class Odds
|
|||||||
public static function grap()
|
public static function grap()
|
||||||
{
|
{
|
||||||
|
|
||||||
$debug = NuhBash::$options['d'] ?? 0;
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
|
|
||||||
if ($debug) {
|
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:
|
case 1:
|
||||||
$markets = '0,4,11534337,5242880,7340033,6291457';
|
$markets = '0,4,11534337,5242880,7340033,6291457';
|
||||||
break;
|
break;
|
||||||
@@ -107,22 +108,22 @@ class Odds
|
|||||||
/*************************************************
|
/*************************************************
|
||||||
* URL
|
* 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 = [];
|
$_calls = [];
|
||||||
if (NuhBash::$options['event_id']) {
|
if (Nuh::$options['event_id']) {
|
||||||
$_calls[] = $url."&ot=$markets&peid=".NuhBash::$options['event_id'];
|
$_calls[] = $url."&ot=$markets&peid=".Nuh::$options['event_id'];
|
||||||
} elseif (NuhBash::$options['a']) {
|
} elseif (Nuh::$options['a']) {
|
||||||
$res = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->pluck('tx_id');
|
$res = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->pluck('tx_id');
|
||||||
foreach ($res as $id) {
|
foreach ($res as $id) {
|
||||||
$_calls[] = $url."&ot=$markets&peid=".$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');
|
$res = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDays(7)->toDateTimeString())->pluck('tx_id');
|
||||||
foreach ($res as $id) {
|
foreach ($res as $id) {
|
||||||
$_calls[] = $url."&ot=$markets&peid=".$id;
|
$_calls[] = $url."&ot=$markets&peid=".$id;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$_calls[] = $url.'&last='.NuhBash::$options['lastcall'];
|
$_calls[] = $url.'&last='.Nuh::$options['lastcall'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************
|
/*************************************************
|
||||||
@@ -132,6 +133,10 @@ class Odds
|
|||||||
|
|
||||||
$data = Xml::load($url);
|
$data = Xml::load($url);
|
||||||
|
|
||||||
|
if ($echo) {
|
||||||
|
dd($data);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($data as $row) {
|
foreach ($data as $row) {
|
||||||
|
|
||||||
$event = [];
|
$event = [];
|
||||||
@@ -177,19 +182,18 @@ class Odds
|
|||||||
'sport_id' => $event['sport_id'],
|
'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) {
|
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 = [];
|
||||||
$odds['sport_id'] = (int) $event['sport_id'];
|
$odds['sport_id'] = (int) $event['sport_id'];
|
||||||
$odds['provider_id'] = 2;
|
|
||||||
|
|
||||||
NuhBash::$_event_bookmaker = [];
|
Nuh::$_event_bookmaker = [];
|
||||||
|
|
||||||
foreach ($book->offer as $offer) {
|
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([
|
EventBookmaker::updateOrCreate([
|
||||||
'event_id' => NuhBash::$_event->id,
|
'event_id' => Nuh::$_event->id,
|
||||||
'bookmaker_id' => NuhBash::$bookmaker_id,
|
'bookmaker_id' => Nuh::$bookmaker_id,
|
||||||
'bookmaker_id' => NuhBash::$bookmaker_id,
|
'bookmaker_id' => Nuh::$bookmaker_id,
|
||||||
], [
|
], [
|
||||||
'bmoid' => $value['bmoid'],
|
'bmoid' => $value['bmoid'],
|
||||||
'provider_id' => 2,
|
'provider_id' => Nuh::$options['provider_id'],
|
||||||
'bkm_starttime' => Carbon::createFromDate($value['starttime'])->toDateTimeString(),
|
'bkm_starttime' => Carbon::createFromDate($value['starttime'])->toDateTimeString(),
|
||||||
'last_check_at' => Carbon::now()->toDateTimeString(),
|
'last_check_at' => Carbon::now()->toDateTimeString(),
|
||||||
]);
|
]);
|
||||||
@@ -255,7 +259,7 @@ class Odds
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note('END '.NuhBash::$_event->id, 'g');
|
Notice::note('END '.Nuh::$_event->id, 'g');
|
||||||
Notice::note('END', 'g');
|
Notice::note('END', 'g');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands\Grapper\TxOdds\Odds;
|
namespace App\Console\Commands\Grapper\TxOdds\Odds;
|
||||||
|
|
||||||
use App\Console\Commands\NuhBash;
|
use App\Console\Commands\Nuh;
|
||||||
use App\Models\Odds3way;
|
use App\Models\Odds3way;
|
||||||
use App\Utilities\Margin;
|
use App\Utilities\Margin;
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
@@ -12,10 +12,10 @@ class _3Way
|
|||||||
{
|
{
|
||||||
public static function grap($odds, $offer)
|
public static function grap($odds, $offer)
|
||||||
{
|
{
|
||||||
$debug = NuhBash::$options['d'] ?? 0;
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note('1X2 '.NuhBash::$bookmaker_id, 'b');
|
Notice::note('1X2 '.Nuh::$bookmaker_id, 'b');
|
||||||
}
|
}
|
||||||
|
|
||||||
$update_array = [];
|
$update_array = [];
|
||||||
@@ -27,7 +27,7 @@ class _3Way
|
|||||||
$bkm_starttime = (string) $value['starting_time'];
|
$bkm_starttime = (string) $value['starting_time'];
|
||||||
}
|
}
|
||||||
|
|
||||||
NuhBash::$_event_bookmaker[] =
|
Nuh::$_event_bookmaker[] =
|
||||||
[
|
[
|
||||||
'bmoid' => $odds['bmoid'],
|
'bmoid' => $odds['bmoid'],
|
||||||
'starttime' => $bkm_starttime,
|
'starttime' => $bkm_starttime,
|
||||||
@@ -37,14 +37,14 @@ class _3Way
|
|||||||
$update_array['sport_id'] = $odds['sport_id'];
|
$update_array['sport_id'] = $odds['sport_id'];
|
||||||
$update_array['offer_id'] = $odds['offer_id'];
|
$update_array['offer_id'] = $odds['offer_id'];
|
||||||
$update_array['flag'] = 1;
|
$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['nuh_check'] = 0;
|
||||||
$update_array['last_check_at'] = Carbon::now()->toDateTimeString();
|
$update_array['last_check_at'] = Carbon::now()->toDateTimeString();
|
||||||
$update_array['source_updated_at'] = $odds['source_updated_at'];
|
$update_array['source_updated_at'] = $odds['source_updated_at'];
|
||||||
|
|
||||||
Odds3way::updateOrCreate([
|
Odds3way::updateOrCreate([
|
||||||
'event_id' => NuhBash::$_event->id,
|
'event_id' => Nuh::$_event->id,
|
||||||
'bookmaker_id' => NuhBash::$bookmaker_id,
|
'bookmaker_id' => Nuh::$bookmaker_id,
|
||||||
], $update_array);
|
], $update_array);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands\Grapper\TxOdds\Odds;
|
namespace App\Console\Commands\Grapper\TxOdds\Odds;
|
||||||
|
|
||||||
use App\Console\Commands\NuhBash;
|
use App\Console\Commands\Nuh;
|
||||||
use App\Models\OddsDc;
|
use App\Models\OddsDc;
|
||||||
use App\Utilities\Margin;
|
use App\Utilities\Margin;
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
@@ -12,10 +12,10 @@ class _Dc
|
|||||||
{
|
{
|
||||||
public static function grap($odds, $offer)
|
public static function grap($odds, $offer)
|
||||||
{
|
{
|
||||||
$debug = NuhBash::$options['d'] ?? 0;
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note('Double Chance '.NuhBash::$bookmaker_id, 'b');
|
Notice::note('Double Chance '.Nuh::$bookmaker_id, 'b');
|
||||||
}
|
}
|
||||||
|
|
||||||
$update_array = [];
|
$update_array = [];
|
||||||
@@ -30,14 +30,14 @@ class _Dc
|
|||||||
$update_array['sport_id'] = $odds['sport_id'];
|
$update_array['sport_id'] = $odds['sport_id'];
|
||||||
$update_array['offer_id'] = $odds['offer_id'];
|
$update_array['offer_id'] = $odds['offer_id'];
|
||||||
$update_array['flag'] = 1;
|
$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['nuh_check'] = 0;
|
||||||
$update_array['last_check_at'] = Carbon::now()->toDateTimeString();
|
$update_array['last_check_at'] = Carbon::now()->toDateTimeString();
|
||||||
$update_array['source_updated_at'] = $odds['source_updated_at'];
|
$update_array['source_updated_at'] = $odds['source_updated_at'];
|
||||||
|
|
||||||
OddsDc::updateOrCreate([
|
OddsDc::updateOrCreate([
|
||||||
'event_id' => NuhBash::$_event->id,
|
'event_id' => Nuh::$_event->id,
|
||||||
'bookmaker_id' => NuhBash::$bookmaker_id,
|
'bookmaker_id' => Nuh::$bookmaker_id,
|
||||||
], $update_array);
|
], $update_array);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands\Grapper\TxOdds\Odds;
|
namespace App\Console\Commands\Grapper\TxOdds\Odds;
|
||||||
|
|
||||||
use App\Console\Commands\NuhBash;
|
use App\Console\Commands\Nuh;
|
||||||
use App\Models\OddsDnb;
|
use App\Models\OddsDnb;
|
||||||
use App\Utilities\Margin;
|
use App\Utilities\Margin;
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
@@ -12,10 +12,10 @@ class _Dnb
|
|||||||
{
|
{
|
||||||
public static function grap($odds, $offer)
|
public static function grap($odds, $offer)
|
||||||
{
|
{
|
||||||
$debug = NuhBash::$options['d'] ?? 0;
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note('Draw No Bet '.NuhBash::$bookmaker_id, 'b');
|
Notice::note('Draw No Bet '.Nuh::$bookmaker_id, 'b');
|
||||||
}
|
}
|
||||||
|
|
||||||
$update_array = [];
|
$update_array = [];
|
||||||
@@ -29,14 +29,14 @@ class _Dnb
|
|||||||
$update_array['sport_id'] = $odds['sport_id'];
|
$update_array['sport_id'] = $odds['sport_id'];
|
||||||
$update_array['offer_id'] = $odds['offer_id'];
|
$update_array['offer_id'] = $odds['offer_id'];
|
||||||
$update_array['flag'] = 1;
|
$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['nuh_check'] = 0;
|
||||||
$update_array['last_check_at'] = Carbon::now()->toDateTimeString();
|
$update_array['last_check_at'] = Carbon::now()->toDateTimeString();
|
||||||
$update_array['source_updated_at'] = $odds['source_updated_at'];
|
$update_array['source_updated_at'] = $odds['source_updated_at'];
|
||||||
|
|
||||||
OddsDnb::updateOrCreate([
|
OddsDnb::updateOrCreate([
|
||||||
'event_id' => NuhBash::$_event->id,
|
'event_id' => Nuh::$_event->id,
|
||||||
'bookmaker_id' => NuhBash::$bookmaker_id,
|
'bookmaker_id' => Nuh::$bookmaker_id,
|
||||||
], $update_array);
|
], $update_array);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands\Grapper\TxOdds\Odds;
|
namespace App\Console\Commands\Grapper\TxOdds\Odds;
|
||||||
|
|
||||||
use App\Console\Commands\NuhBash;
|
use App\Console\Commands\Nuh;
|
||||||
use App\Models\OddsGgng;
|
use App\Models\OddsGgng;
|
||||||
use App\Utilities\Margin;
|
use App\Utilities\Margin;
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
@@ -12,10 +12,10 @@ class _Ggng
|
|||||||
{
|
{
|
||||||
public static function grap($odds, $offer)
|
public static function grap($odds, $offer)
|
||||||
{
|
{
|
||||||
$debug = NuhBash::$options['d'] ?? 0;
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note('Goal No Goal '.NuhBash::$bookmaker_id, 'b');
|
Notice::note('Goal No Goal '.Nuh::$bookmaker_id, 'b');
|
||||||
}
|
}
|
||||||
|
|
||||||
$update_array = [];
|
$update_array = [];
|
||||||
@@ -29,14 +29,14 @@ class _Ggng
|
|||||||
$update_array['sport_id'] = $odds['sport_id'];
|
$update_array['sport_id'] = $odds['sport_id'];
|
||||||
$update_array['offer_id'] = $odds['offer_id'];
|
$update_array['offer_id'] = $odds['offer_id'];
|
||||||
$update_array['flag'] = 1;
|
$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['nuh_check'] = 0;
|
||||||
$update_array['last_check_at'] = Carbon::now()->toDateTimeString();
|
$update_array['last_check_at'] = Carbon::now()->toDateTimeString();
|
||||||
$update_array['source_updated_at'] = $odds['source_updated_at'];
|
$update_array['source_updated_at'] = $odds['source_updated_at'];
|
||||||
|
|
||||||
OddsGgng::updateOrCreate([
|
OddsGgng::updateOrCreate([
|
||||||
'event_id' => NuhBash::$_event->id,
|
'event_id' => Nuh::$_event->id,
|
||||||
'bookmaker_id' => NuhBash::$bookmaker_id,
|
'bookmaker_id' => Nuh::$bookmaker_id,
|
||||||
], $update_array);
|
], $update_array);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands\Grapper\TxOdds\Odds;
|
namespace App\Console\Commands\Grapper\TxOdds\Odds;
|
||||||
|
|
||||||
use App\Console\Commands\NuhBash;
|
use App\Console\Commands\Nuh;
|
||||||
use App\Models\OddsTotal;
|
use App\Models\OddsTotal;
|
||||||
use App\Utilities\Margin;
|
use App\Utilities\Margin;
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
@@ -12,10 +12,10 @@ class _Totals
|
|||||||
{
|
{
|
||||||
public static function grap($odds, $offer)
|
public static function grap($odds, $offer)
|
||||||
{
|
{
|
||||||
$debug = NuhBash::$options['d'] ?? 0;
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note('Totals '.NuhBash::$bookmaker_id, 'b');
|
Notice::note('Totals '.Nuh::$bookmaker_id, 'b');
|
||||||
}
|
}
|
||||||
|
|
||||||
$update_array = [];
|
$update_array = [];
|
||||||
@@ -38,14 +38,14 @@ class _Totals
|
|||||||
$update_array['sport_id'] = $odds['sport_id'];
|
$update_array['sport_id'] = $odds['sport_id'];
|
||||||
$update_array['offer_id'] = $odds['offer_id'];
|
$update_array['offer_id'] = $odds['offer_id'];
|
||||||
$update_array['flag'] = 1;
|
$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['nuh_check'] = 0;
|
||||||
$update_array['last_check_at'] = Carbon::now()->toDateTimeString();
|
$update_array['last_check_at'] = Carbon::now()->toDateTimeString();
|
||||||
$update_array['source_updated_at'] = $odds['source_updated_at'];
|
$update_array['source_updated_at'] = $odds['source_updated_at'];
|
||||||
|
|
||||||
OddsTotal::updateOrCreate([
|
OddsTotal::updateOrCreate([
|
||||||
'event_id' => NuhBash::$_event->id,
|
'event_id' => Nuh::$_event->id,
|
||||||
'bookmaker_id' => NuhBash::$bookmaker_id,
|
'bookmaker_id' => Nuh::$bookmaker_id,
|
||||||
], $update_array);
|
], $update_array);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands\Grapper\TxOdds\Odds;
|
namespace App\Console\Commands\Grapper\TxOdds\Odds;
|
||||||
|
|
||||||
use App\Console\Commands\NuhBash;
|
use App\Console\Commands\Nuh;
|
||||||
use App\Models\OddsQualify;
|
use App\Models\OddsQualify;
|
||||||
use App\Utilities\Margin;
|
use App\Utilities\Margin;
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
@@ -12,10 +12,10 @@ class _Tq
|
|||||||
{
|
{
|
||||||
public static function grap($odds, $offer)
|
public static function grap($odds, $offer)
|
||||||
{
|
{
|
||||||
$debug = NuhBash::$options['d'] ?? 0;
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note('To Qualify '.NuhBash::$bookmaker_id, 'b');
|
Notice::note('To Qualify '.Nuh::$bookmaker_id, 'b');
|
||||||
}
|
}
|
||||||
|
|
||||||
$update_array = [];
|
$update_array = [];
|
||||||
@@ -29,14 +29,14 @@ class _Tq
|
|||||||
$update_array['sport_id'] = $odds['sport_id'];
|
$update_array['sport_id'] = $odds['sport_id'];
|
||||||
$update_array['offer_id'] = $odds['offer_id'];
|
$update_array['offer_id'] = $odds['offer_id'];
|
||||||
$update_array['flag'] = 1;
|
$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['nuh_check'] = 0;
|
||||||
$update_array['last_check_at'] = Carbon::now()->toDateTimeString();
|
$update_array['last_check_at'] = Carbon::now()->toDateTimeString();
|
||||||
$update_array['source_updated_at'] = $odds['source_updated_at'];
|
$update_array['source_updated_at'] = $odds['source_updated_at'];
|
||||||
|
|
||||||
OddsQualify::updateOrCreate([
|
OddsQualify::updateOrCreate([
|
||||||
'event_id' => NuhBash::$_event->id,
|
'event_id' => Nuh::$_event->id,
|
||||||
'bookmaker_id' => NuhBash::$bookmaker_id,
|
'bookmaker_id' => Nuh::$bookmaker_id,
|
||||||
], $update_array);
|
], $update_array);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,14 +2,15 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands;
|
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\Models\Supervisor;
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
use App\Utilities\Supervisorctl;
|
use App\Utilities\Supervisorctl;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
class NuhBash extends Command
|
class Nuh extends Command
|
||||||
{
|
{
|
||||||
public static $options = [];
|
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 $signature = 'nuh {process=help} {eventid=0} {--d} {--f} {--a} {--w} {--p} {--s} {--r} {--b} {--q}';
|
||||||
|
|
||||||
protected $description = 'NuhBash';
|
protected $description = 'Nuh';
|
||||||
|
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
@@ -49,7 +50,8 @@ class NuhBash extends Command
|
|||||||
$txt .= '--f force update market'.PHP_EOL;
|
$txt .= '--f force update market'.PHP_EOL;
|
||||||
$txt .= '--a reload all'.PHP_EOL;
|
$txt .= '--a reload all'.PHP_EOL;
|
||||||
$txt .= '--w reload one week'.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 .= '--s store data to file '.PHP_EOL;
|
||||||
$txt .= '--r read data from file '.PHP_EOL;
|
$txt .= '--r read data from file '.PHP_EOL;
|
||||||
$txt .= '--b break loop after one '.PHP_EOL;
|
$txt .= '--b break loop after one '.PHP_EOL;
|
||||||
@@ -75,13 +77,23 @@ class NuhBash extends Command
|
|||||||
|
|
||||||
switch (self::$options['provider_id']) {
|
switch (self::$options['provider_id']) {
|
||||||
case 1:
|
case 1:
|
||||||
// direct
|
TxOdds::switch();
|
||||||
break;
|
|
||||||
case 2:
|
case 2:
|
||||||
TxSwitch::switch();
|
|
||||||
case 3:
|
|
||||||
// betsapi
|
// betsapi
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
|
// MAGLOO KENIA
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
// MAGLOO NIGERIA
|
||||||
|
Magloo::switch();
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
// LOGIFUTUR NIGERA
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
// LOGIFUTUR COLOMBIA
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
Notice::note('Provider not defined', 'r', 1);
|
Notice::note('Provider not defined', 'r', 1);
|
||||||
break;
|
break;
|
||||||
@@ -10,11 +10,11 @@ class Xml
|
|||||||
|
|
||||||
public static function load($url)
|
public static function load($url)
|
||||||
{
|
{
|
||||||
$debug = NuhBash::$options['d'] ?? 0;
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
$save = NuhBash::$options['s'] ?? 0;
|
$save = Nuh::$options['s'] ?? 0;
|
||||||
$read = NuhBash::$options['r'] ?? 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) {
|
if ($debug) {
|
||||||
Notice::note("Loading URL\n".$url);
|
Notice::note("Loading URL\n".$url);
|
||||||
|
|||||||
@@ -2,9 +2,17 @@
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
|
use App\Utilities\Notice;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class Sport extends 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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -14,7 +14,6 @@ return new class extends Migration
|
|||||||
Schema::create('providers', function (Blueprint $table) {
|
Schema::create('providers', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->timestamps();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ class DatabaseSeeder extends Seeder
|
|||||||
SupervisorSeeder::class,
|
SupervisorSeeder::class,
|
||||||
BettypeSeeder::class,
|
BettypeSeeder::class,
|
||||||
MultilineSettingSeeder::class,
|
MultilineSettingSeeder::class,
|
||||||
MultilineClientsSeeder::class,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,15 +12,14 @@ class ProvoiderSeeder extends Seeder
|
|||||||
/**
|
/**
|
||||||
* Provoider
|
* Provoider
|
||||||
*/
|
*/
|
||||||
$sql = "INSERT INTO `providers` (`id`, `name`, `created_at`, `updated_at`)
|
$sql = "INSERT INTO `providers` (`id`, `name`)
|
||||||
VALUES
|
VALUES
|
||||||
('1', 'DIRECT', NULL, NULL),
|
('1', 'TXODDS'),
|
||||||
('2', 'TXODDS', NULL, NULL),
|
('2', 'BETSAPI'),
|
||||||
('3', 'BETSAPI', NULL, NULL),
|
('3', 'MAGLOO KENIA'),
|
||||||
('4', 'MAGLOO KENIA', NULL, NULL),
|
('4', 'MAGLOO NIGERIA'),
|
||||||
('5', 'MAGLOO NIGERIA', NULL, NULL),
|
('5', 'LOGIFUTUR NIGERA'),
|
||||||
('6', 'LOGIFUTUR NIGERA', NULL, NULL),
|
('6', 'LOGIFUTUR COLOMBIA');
|
||||||
('7', 'LOGIFUTUR COLOMBIA', NULL, NULL);
|
|
||||||
";
|
";
|
||||||
DB::unprepared($sql);
|
DB::unprepared($sql);
|
||||||
|
|
||||||
|
|||||||
@@ -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`)
|
$sql = "INSERT INTO `supervisors` (`id`, `name`, `provider_id`, `sport_id`, `sleep`, `limit`, `runtime`, `maxsconds`, `lastcall`, `is_cron`, `is_active`, `created_at`, `updated_at`)
|
||||||
VALUES
|
VALUES
|
||||||
('1', 'Fixtures', '2', '1', '10', '0', NULL, '1800', '0', '1', '1', '2025-08-27 07:39:55', '2025-12-01 05:07:21'),
|
(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', '2', '1', '10', '0', NULL, '30', '0', '0', '1', '2025-12-01 05:41:02', '2025-12-01 05:41:02');
|
(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);
|
DB::unprepared($sql);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user