wip
This commit is contained in:
1 parent
60379bcab8
commit
5c9745b1da
19 files changed
+167
-105
No files matched your search
@@ -3,7 +3,7 @@
|
||||
namespace App\Console\Commands\Grapper\TxOdds;
|
||||
|
||||
use App\Console\Commands\Curl;
|
||||
use App\Console\Commands\NuhBash;
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Models\Country;
|
||||
use App\Utilities\Notice;
|
||||
|
||||
@@ -11,8 +11,8 @@ class Countries
|
||||
{
|
||||
public static function call()
|
||||
{
|
||||
$debug = NuhBash::$options['d'] ?? 0;
|
||||
$print = NuhBash::$options['p'] ?? 0;
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
$print = Nuh::$options['p'] ?? 0;
|
||||
|
||||
$url = 'https://xml2.txodds.com/feed/countries.php';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Console\Commands\Grapper\TxOdds;
|
||||
|
||||
use App\Console\Commands\NuhBash;
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Console\Commands\Xml;
|
||||
use App\Models\CompetitionGroup;
|
||||
use App\Models\Element;
|
||||
@@ -15,9 +15,9 @@ class Fixtures
|
||||
{
|
||||
public static function grap()
|
||||
{
|
||||
$debug = NuhBash::$options['d'] ?? 0;
|
||||
$print = NuhBash::$options['p'] ?? 0;
|
||||
$break = NuhBash::$options['b'] ?? 0;
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
$echo = Nuh::$options['e'] ?? 0;
|
||||
$break = Nuh::$options['b'] ?? 0;
|
||||
|
||||
$count = 0;
|
||||
$total = 0;
|
||||
@@ -40,11 +40,11 @@ class Fixtures
|
||||
$from = $now->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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user