wip matches
This commit is contained in:
1 parent
adb15e701b
commit
7116d3c576
33 files changed
+374
-171
No files matched your search
+6
-4
@@ -1,8 +1,10 @@
|
|||||||
APP_NAME=Laravel
|
APP_NAME=NuhOdds
|
||||||
APP_ENV=local
|
APP_ENV=local
|
||||||
APP_KEY=
|
APP_KEY=base64:xhigDJOEk2dBUc3pfYXm7yo8a14PTtVCIU4PAt+F2dM=
|
||||||
APP_DEBUG=true
|
APP_DEBUG=true
|
||||||
APP_URL=http://localhost
|
APP_URL=http://nuhodds_fi4.test
|
||||||
|
BETSAPI_TOKEN="36152-aeTRNnZxSPUwGe"
|
||||||
|
TXODDS_TOKEN="Dy59vpRC"
|
||||||
|
|
||||||
APP_LOCALE=en
|
APP_LOCALE=en
|
||||||
APP_FALLBACK_LOCALE=en
|
APP_FALLBACK_LOCALE=en
|
||||||
@@ -25,7 +27,7 @@ DB_HOST=127.0.0.1
|
|||||||
DB_PORT=3306
|
DB_PORT=3306
|
||||||
DB_DATABASE=nuhodds_fi4
|
DB_DATABASE=nuhodds_fi4
|
||||||
DB_USERNAME=root
|
DB_USERNAME=root
|
||||||
DB_PASSWORD=
|
DB_PASSWORD=salam
|
||||||
|
|
||||||
SESSION_DRIVER=database
|
SESSION_DRIVER=database
|
||||||
SESSION_LIFETIME=120
|
SESSION_LIFETIME=120
|
||||||
|
|||||||
@@ -1,17 +1,34 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Utilities;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Utilities\Notice;
|
||||||
|
|
||||||
class Curl
|
class Curl
|
||||||
{
|
{
|
||||||
public static function load($url, $debug = 0)
|
public static $storage_file;
|
||||||
|
|
||||||
|
public static function load($url)
|
||||||
{
|
{
|
||||||
BetsapiCounter::count($debug);
|
self::$storage_file = app_path().'/Utilities/TestFileStorage/latest.json';
|
||||||
|
|
||||||
|
$debug = NuhBash::$options['debug'] ?? 0;
|
||||||
|
$save_to_storage = NuhBash::$options['s'] ?? 0;
|
||||||
|
$load_form_storage = NuhBash::$options['l'] ?? 0;
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note($url, 'g');
|
Notice::note($url, 'g');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($load_form_storage) {
|
||||||
|
$file = file_get_contents(self::$storage_file);
|
||||||
|
if ($debug) {
|
||||||
|
Notice::note('data from storage', 'b');
|
||||||
|
}
|
||||||
|
|
||||||
|
return json_decode($file, true);
|
||||||
|
}
|
||||||
|
|
||||||
$ch = curl_init($url);
|
$ch = curl_init($url);
|
||||||
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
|
||||||
@@ -24,6 +41,11 @@ class Curl
|
|||||||
}
|
}
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
|
|
||||||
|
if ($save_to_storage) {
|
||||||
|
Notice::note('data saved to local storage', 'b');
|
||||||
|
file_put_contents(self::$storage_file, $data);
|
||||||
|
}
|
||||||
|
|
||||||
return json_decode($data, true);
|
return json_decode($data, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper;
|
|
||||||
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
|
|
||||||
class Helper
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Create a new class instance.
|
|
||||||
*/
|
|
||||||
public static function get_auth_string()
|
|
||||||
{
|
|
||||||
if (Grapper::$options['provider_id'] == 1) {
|
|
||||||
// txodds soccer
|
|
||||||
Grapper::$auth = 'ident=betaid1&passwd=Dy59vpRC';
|
|
||||||
Grapper::$domain = 'https://xml2.txodds.com/';
|
|
||||||
} elseif (Grapper::$options['provider_id'] == 3) {
|
|
||||||
// txodds others
|
|
||||||
Grapper::$auth = 'ident=betaid2&passwd=Dy59vpRC';
|
|
||||||
Grapper::$domain = 'https://xml2.txodds.com/';
|
|
||||||
} else {
|
|
||||||
Notice::note('error txodds provider', 'r', 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function margin($arr)
|
|
||||||
{
|
|
||||||
$r = 0;
|
|
||||||
foreach ($arr as $key => $value) {
|
|
||||||
$r += 100 / $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return round($r, 3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands\Grapper\TxOdds;
|
||||||
|
|
||||||
|
use App\Models\Element;
|
||||||
|
|
||||||
|
class TxElement
|
||||||
|
{
|
||||||
|
public static function find($element, $sport_id)
|
||||||
|
{
|
||||||
|
|
||||||
|
// dd($element);
|
||||||
|
|
||||||
|
$txodds_id = array_column($element, 'id');
|
||||||
|
|
||||||
|
$element = Element::firstOrCreate([
|
||||||
|
'name' => (string) $element['@text'],
|
||||||
|
'sport_id' => $sport_id,
|
||||||
|
'txodds_id' => (int) $txodds_id[0],
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $element->id;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands\Grapper\TxOdds;
|
||||||
|
|
||||||
|
use App\Console\Commands\NuhBash;
|
||||||
|
use App\Models\Country;
|
||||||
|
use App\Models\Liga;
|
||||||
|
|
||||||
|
class TxLigas
|
||||||
|
{
|
||||||
|
public static function find($group)
|
||||||
|
{
|
||||||
|
$debug = NuhBash::$options['debug'] ?? 0;
|
||||||
|
|
||||||
|
$cgid = array_column($group, 'cgid');
|
||||||
|
$cnid = array_column($group, 'cnid');
|
||||||
|
$spid = array_column($group, 'spid');
|
||||||
|
$cname = array_column($group, 'cname');
|
||||||
|
|
||||||
|
$country_id = Country::where('txid', $cnid)->value('id');
|
||||||
|
|
||||||
|
$liga = Liga::firstOrCreate([
|
||||||
|
'name' => (string) $cname[0],
|
||||||
|
'sport_id' => (int) $spid[0],
|
||||||
|
'country_id' => $country_id,
|
||||||
|
'txodds_id' => (int) $cgid[0],
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $liga->id;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands\Grapper\TxOdds;
|
||||||
|
|
||||||
|
use App\Console\Commands\Curl;
|
||||||
|
use App\Console\Commands\NuhBash;
|
||||||
|
use App\Models\Event;
|
||||||
|
|
||||||
|
class FixturesSoccer
|
||||||
|
{
|
||||||
|
public static function call()
|
||||||
|
{
|
||||||
|
$debug = NuhBash::$options['debug'] ?? 0;
|
||||||
|
|
||||||
|
for ($i = 0; $i < 30; $i++) {
|
||||||
|
$str1 = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d') + $i, date('Y')));
|
||||||
|
$str2 = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d') + 1 + $i, date('Y')));
|
||||||
|
|
||||||
|
$url = 'https://xml2.txodds.com/feed/result/xml.php?ident=betaid1&passwd='.config('nuh.txodds_token')."&date=$str1,$str2&json=2";
|
||||||
|
|
||||||
|
$data = Curl::load($url, $debug);
|
||||||
|
|
||||||
|
foreach ($data['match'] as $row) {
|
||||||
|
|
||||||
|
$txodds_id = array_column($row, 'id');
|
||||||
|
$spid = array_column($row['group'], 'spid');
|
||||||
|
$liga_id = TxLigas::find($row['group']);
|
||||||
|
$home_id = TxElement::find($row['hteam'], 1);
|
||||||
|
$away_id = TxElement::find($row['ateam'], 1);
|
||||||
|
|
||||||
|
$event = Event::firstOrCreate([
|
||||||
|
'starttime' => date('Y-m-d H:i:s', strtotime($row['time'])),
|
||||||
|
'sport_id' => (int) $spid[0],
|
||||||
|
'provider_id' => 1,
|
||||||
|
'txodds_id' => (int) $txodds_id,
|
||||||
|
'liga_id' => $liga_id,
|
||||||
|
'home_id' => $home_id,
|
||||||
|
'away_id' => $away_id,
|
||||||
|
]);
|
||||||
|
|
||||||
|
dd($event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+8
-10
@@ -1,34 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Console\Commands\Grapper\TxOdds;
|
namespace App\Console\Commands\Grapper;
|
||||||
|
|
||||||
use App\Console\Commands\Grapper\Grapper;
|
use App\Console\Commands\Grapper\TxOdds\FixturesSoccer;
|
||||||
|
use App\Console\Commands\NuhBash;
|
||||||
|
|
||||||
class TxOdds
|
class TxSwitch
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* https://docs.guzzlephp.org/en/latest/
|
* https://docs.guzzlephp.org/en/latest/
|
||||||
*/
|
*/
|
||||||
public static function switch()
|
public static function switch()
|
||||||
{
|
{
|
||||||
switch (Grapper::$options['option_id']) {
|
|
||||||
|
switch (NuhBash::$options['id']) {
|
||||||
case 1:
|
case 1:
|
||||||
// Leages
|
FixturesSoccer::call();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
Events::grap();
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
// Flags
|
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
Odds::grap();
|
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
Countries::grap();
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Note::notice('Provider not defined', 'r', 1);
|
Note::notice('wrong process id for txodds', 'r', 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use App\Console\Commands\Grapper\TxOdds\TxOdds;
|
use App\Console\Commands\Grapper\TxSwitch;
|
||||||
use App\Models\Supervisor;
|
use App\Models\Supervisor;
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
use App\Utilities\Supervisorctl;
|
use App\Utilities\Supervisorctl;
|
||||||
@@ -26,7 +26,7 @@ class NuhBash extends Command
|
|||||||
|
|
||||||
public static $auth = '';
|
public static $auth = '';
|
||||||
|
|
||||||
protected $signature = 'nuh {process=help} {eventid=0} {--d} {--f} {--a} {--p} {--w}';
|
protected $signature = 'nuh {process=help} {eventid=0} {--d} {--f} {--a} {--p} {--w} {--s} {--l}';
|
||||||
|
|
||||||
protected $description = 'NuhBash';
|
protected $description = 'NuhBash';
|
||||||
|
|
||||||
@@ -38,11 +38,12 @@ class NuhBash extends Command
|
|||||||
self::$options['event_id'] = $this->argument('eventid');
|
self::$options['event_id'] = $this->argument('eventid');
|
||||||
|
|
||||||
if ($this->argument('process') == 'help') {
|
if ($this->argument('process') == 'help') {
|
||||||
$txt = 'List of parameters'.PHP_EOL;
|
$txt = PHP_EOL;
|
||||||
|
$txt .= 'List of parameters'.PHP_EOL;
|
||||||
$txt .= '----------------------------------------------'.PHP_EOL;
|
$txt .= '----------------------------------------------'.PHP_EOL;
|
||||||
$txt .= 'process [id] (required)'.PHP_EOL;
|
$txt .= 'process [id] (required)'.PHP_EOL;
|
||||||
$txt .= 'eventid [id] (optional)'.PHP_EOL;
|
$txt .= 'eventid [id] (optional)'.PHP_EOL;
|
||||||
$txt .= '----------------------------------------------'.PHP_EOL;
|
$txt .= '----------------------------------------------'.PHP_EOL.PHP_EOL;
|
||||||
$txt .= 'List of options'.PHP_EOL;
|
$txt .= 'List of options'.PHP_EOL;
|
||||||
$txt .= '----------------------------------------------'.PHP_EOL;
|
$txt .= '----------------------------------------------'.PHP_EOL;
|
||||||
$txt .= '--d debug'.PHP_EOL;
|
$txt .= '--d debug'.PHP_EOL;
|
||||||
@@ -50,7 +51,9 @@ class NuhBash extends Command
|
|||||||
$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 odds'.PHP_EOL;
|
$txt .= '--p print odds'.PHP_EOL;
|
||||||
$txt .= '----------------------------------------------'.PHP_EOL;
|
$txt .= '--s store grapped file '.PHP_EOL;
|
||||||
|
$txt .= '--l load latest grapped file '.PHP_EOL;
|
||||||
|
$txt .= '----------------------------------------------'.PHP_EOL.PHP_EOL;
|
||||||
$txt .= 'List of supervisors'.PHP_EOL;
|
$txt .= 'List of supervisors'.PHP_EOL;
|
||||||
$txt .= '----------------------------------------------'.PHP_EOL;
|
$txt .= '----------------------------------------------'.PHP_EOL;
|
||||||
$tmp = Supervisor::all();
|
$tmp = Supervisor::all();
|
||||||
@@ -62,20 +65,27 @@ class NuhBash extends Command
|
|||||||
|
|
||||||
Supervisorctl::start(self::$options);
|
Supervisorctl::start(self::$options);
|
||||||
|
|
||||||
Helper::get_auth_string();
|
switch (self::$options['type']) {
|
||||||
|
case 'Grapper':
|
||||||
switch (self::$options['provider_id']) {
|
switch (self::$options['provider_id']) {
|
||||||
case 1:
|
case 1:
|
||||||
|
TxSwitch::switch();
|
||||||
case 2:
|
case 2:
|
||||||
TxOdds::switch();
|
// betsapi
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
// betsapi
|
// direct
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Note::notice('Provider not defined', 'r', 1);
|
Note::notice('Provider not defined', 'r', 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Comparatore':
|
||||||
|
// code...
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
Supervisorctl::end(self::$options);
|
Supervisorctl::end(self::$options);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace App\Filament\Clusters\Maintenance\Resources\Events\Tables;
|
|||||||
use Filament\Actions\BulkActionGroup;
|
use Filament\Actions\BulkActionGroup;
|
||||||
use Filament\Actions\DeleteBulkAction;
|
use Filament\Actions\DeleteBulkAction;
|
||||||
use Filament\Actions\EditAction;
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Tables\Columns\IconColumn;
|
||||||
use Filament\Tables\Columns\TextColumn;
|
use Filament\Tables\Columns\TextColumn;
|
||||||
use Filament\Tables\Table;
|
use Filament\Tables\Table;
|
||||||
|
|
||||||
@@ -14,45 +15,47 @@ class EventsTable
|
|||||||
{
|
{
|
||||||
return $table
|
return $table
|
||||||
->columns([
|
->columns([
|
||||||
TextColumn::make('time')
|
IconColumn::make('sport_id')
|
||||||
->dateTime()
|
->label('')
|
||||||
->sortable(),
|
->icon(function ($record): string {
|
||||||
TextColumn::make('spid')
|
return $record->sport->icon;
|
||||||
->numeric()
|
}),
|
||||||
->sortable(),
|
TextColumn::make('starttime')->dateTime('M j, Y H:i')->sortable(),
|
||||||
TextColumn::make('prid')
|
TextColumn::make('liga.name')->searchable(),
|
||||||
->numeric()
|
TextColumn::make('home.name')->searchable(),
|
||||||
->sortable(),
|
TextColumn::make('away.name')->searchable(),
|
||||||
TextColumn::make('txid')
|
// TextColumn::make('prid')
|
||||||
->numeric()
|
// ->numeric()
|
||||||
->sortable(),
|
// ->sortable(),
|
||||||
TextColumn::make('brid')
|
// TextColumn::make('txid')
|
||||||
->numeric()
|
// ->numeric()
|
||||||
->sortable(),
|
// ->sortable(),
|
||||||
TextColumn::make('baid')
|
// TextColumn::make('brid')
|
||||||
->numeric()
|
// ->numeric()
|
||||||
->sortable(),
|
// ->sortable(),
|
||||||
TextColumn::make('cnid')
|
// TextColumn::make('baid')
|
||||||
->numeric()
|
// ->numeric()
|
||||||
->sortable(),
|
// ->sortable(),
|
||||||
TextColumn::make('grid')
|
// TextColumn::make('cnid')
|
||||||
->numeric()
|
// ->numeric()
|
||||||
->sortable(),
|
// ->sortable(),
|
||||||
TextColumn::make('cgid')
|
// TextColumn::make('grid')
|
||||||
->numeric()
|
// ->numeric()
|
||||||
->sortable(),
|
// ->sortable(),
|
||||||
TextColumn::make('hoid')
|
// TextColumn::make('cgid')
|
||||||
->numeric()
|
// ->numeric()
|
||||||
->sortable(),
|
// ->sortable(),
|
||||||
TextColumn::make('awid')
|
// TextColumn::make('hoid')
|
||||||
->numeric()
|
// ->numeric()
|
||||||
->sortable(),
|
// ->sortable(),
|
||||||
TextColumn::make('liga')
|
// TextColumn::make('awid')
|
||||||
->searchable(),
|
// ->numeric()
|
||||||
TextColumn::make('home')
|
// ->sortable(),
|
||||||
->searchable(),
|
// TextColumn::make('liga')
|
||||||
TextColumn::make('away')
|
// ->searchable(),
|
||||||
->searchable(),
|
|
||||||
|
// TextColumn::make('away')
|
||||||
|
// ->searchable(),
|
||||||
TextColumn::make('created_at')
|
TextColumn::make('created_at')
|
||||||
->dateTime()
|
->dateTime()
|
||||||
->sortable()
|
->sortable()
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use App\Models\Sport;
|
|||||||
use BackedEnum;
|
use BackedEnum;
|
||||||
use Filament\Resources\Resource;
|
use Filament\Resources\Resource;
|
||||||
use Filament\Schemas\Schema;
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Support\Enums\IconSize;
|
||||||
use Filament\Tables\Columns\IconColumn;
|
use Filament\Tables\Columns\IconColumn;
|
||||||
use Filament\Tables\Columns\TextColumn;
|
use Filament\Tables\Columns\TextColumn;
|
||||||
use Filament\Tables\Columns\ToggleColumn;
|
use Filament\Tables\Columns\ToggleColumn;
|
||||||
@@ -43,21 +44,16 @@ class SportResource extends Resource
|
|||||||
->columns([
|
->columns([
|
||||||
IconColumn::make('icon')
|
IconColumn::make('icon')
|
||||||
->label('')
|
->label('')
|
||||||
|
->size(IconSize::TwoExtraLarge)
|
||||||
->icon(function ($record): string {
|
->icon(function ($record): string {
|
||||||
return $record->icon;
|
return $record->icon;
|
||||||
})->color(function ($record): string {
|
|
||||||
if ($record->is_active == 1) {
|
|
||||||
return 'primary';
|
|
||||||
} else {
|
|
||||||
return 'gray';
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
TextColumn::make('name'),
|
TextColumn::make('name'),
|
||||||
TextColumn::make('bapi'),
|
TextColumn::make('bapi')->alignCenter()->label('Betsapi'),
|
||||||
TextColumn::make('bwin'),
|
TextColumn::make('bwin')->alignCenter()->label('Bwin'),
|
||||||
TextColumn::make('b365'),
|
TextColumn::make('b365')->alignCenter()->label('Bet365'),
|
||||||
TextColumn::make('logi'),
|
TextColumn::make('logi')->alignCenter()->label('Logifuture'),
|
||||||
TextColumn::make('magl'),
|
TextColumn::make('magl')->alignCenter()->label('Magloo'),
|
||||||
ToggleColumn::make('is_active'),
|
ToggleColumn::make('is_active'),
|
||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class SupervisorForm
|
|||||||
'Grapper' => 'Grapper',
|
'Grapper' => 'Grapper',
|
||||||
'Comparatore' => 'Comparatore',
|
'Comparatore' => 'Comparatore',
|
||||||
])
|
])
|
||||||
->default('grapper')
|
->default('Grapper')
|
||||||
->selectablePlaceholder(false),
|
->selectablePlaceholder(false),
|
||||||
Select::make('provider_id')
|
Select::make('provider_id')
|
||||||
->relationship('provider', 'name')
|
->relationship('provider', 'name')
|
||||||
|
|||||||
@@ -18,8 +18,7 @@ class SupervisorsTable
|
|||||||
return $table
|
return $table
|
||||||
->columns([
|
->columns([
|
||||||
TextColumn::make('id')->badge(),
|
TextColumn::make('id')->badge(),
|
||||||
TextColumn::make('name')
|
TextColumn::make('name')->searchable(),
|
||||||
->searchable(),
|
|
||||||
TextColumn::make('type')->badge(),
|
TextColumn::make('type')->badge(),
|
||||||
TextColumn::make('provider.name')
|
TextColumn::make('provider.name')
|
||||||
->badge()->color(fn (string $state): string => match ($state) {
|
->badge()->color(fn (string $state): string => match ($state) {
|
||||||
@@ -40,7 +39,6 @@ class SupervisorsTable
|
|||||||
TextColumn::make('runtime'),
|
TextColumn::make('runtime'),
|
||||||
TextColumn::make('lastcall'),
|
TextColumn::make('lastcall'),
|
||||||
IconColumn::make('is_cron')->boolean()->label('Cron')->falseColor('gray'),
|
IconColumn::make('is_cron')->boolean()->label('Cron')->falseColor('gray'),
|
||||||
ToggleColumn::make('is_active')->label('On/Off'),
|
|
||||||
TextColumn::make('created_at')
|
TextColumn::make('created_at')
|
||||||
->dateTime()
|
->dateTime()
|
||||||
->sortable()
|
->sortable()
|
||||||
@@ -49,6 +47,7 @@ class SupervisorsTable
|
|||||||
->dateTime()
|
->dateTime()
|
||||||
->sortable()
|
->sortable()
|
||||||
->toggleable(isToggledHiddenByDefault: true),
|
->toggleable(isToggledHiddenByDefault: true),
|
||||||
|
ToggleColumn::make('is_active')->label('On/Off'),
|
||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Element extends Model
|
||||||
|
{
|
||||||
|
protected $fillable = [
|
||||||
|
'name',
|
||||||
|
'sport_id',
|
||||||
|
'txodds_id',
|
||||||
|
'betsapi_id',
|
||||||
|
'mag_id',
|
||||||
|
'log_id',
|
||||||
|
];
|
||||||
|
}
|
||||||
+35
-1
@@ -6,5 +6,39 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
|
|
||||||
class Event extends Model
|
class Event extends Model
|
||||||
{
|
{
|
||||||
//
|
protected $fillable = [
|
||||||
|
'starttime',
|
||||||
|
'sport_id',
|
||||||
|
'provider_id',
|
||||||
|
'txodds_id',
|
||||||
|
'betaid_id',
|
||||||
|
'betradar_id',
|
||||||
|
'magnig_id',
|
||||||
|
'magken_id',
|
||||||
|
'lognig_id',
|
||||||
|
'logcol_id',
|
||||||
|
'liga_id',
|
||||||
|
'home_id',
|
||||||
|
'away_id',
|
||||||
|
];
|
||||||
|
|
||||||
|
public function home()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Element::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function away()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Element::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function sport()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Sport::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function liga()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Liga::class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Liga extends Model
|
||||||
|
{
|
||||||
|
protected $fillable = [
|
||||||
|
'name',
|
||||||
|
'sport_id',
|
||||||
|
'country_id',
|
||||||
|
'txodds_id',
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Utilities;
|
||||||
|
|
||||||
|
class Margin
|
||||||
|
{
|
||||||
|
public static function margin($arr)
|
||||||
|
{
|
||||||
|
if (! is_array($arr)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$r = 0;
|
||||||
|
foreach ($arr as $key => $value) {
|
||||||
|
$r += 100 / $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return round($r, 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,32 +16,32 @@ class Supervisorctl
|
|||||||
{
|
{
|
||||||
$debug = $options['d'] ?? 0;
|
$debug = $options['d'] ?? 0;
|
||||||
|
|
||||||
// sleep 1 sec to avoid error in supervisor
|
// sleep for 0,5 seconds
|
||||||
sleep(1);
|
usleep(500000);
|
||||||
|
|
||||||
self::$starttime = microtime(true);
|
self::$starttime = microtime(true);
|
||||||
|
|
||||||
self::$code = $options['code'];
|
self::$code = $options['supervisor_id'];
|
||||||
|
|
||||||
$supervisor = Supervisor::where('code', self::$code)->get()->first();
|
$supervisor = Supervisor::find(self::$code);
|
||||||
|
|
||||||
// if process can be called only from bash
|
|
||||||
if ($supervisor) {
|
if ($supervisor) {
|
||||||
$options['sport_id'] = $supervisor->sport_id;
|
|
||||||
$options['customer_id'] = $supervisor->customer_id;
|
|
||||||
$options['limit'] = $supervisor->limit;
|
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note('supervisor start '.self::$code, 'g');
|
Notice::note('supervisor start '.self::$code, 'g');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($supervisor->sleep > 0) {
|
$options = array_merge($options, $supervisor->toArray());
|
||||||
|
|
||||||
|
if ($options['sleep'] > 0) {
|
||||||
if (! $debug) {
|
if (! $debug) {
|
||||||
sleep($supervisor->sleep);
|
sleep($options['sleep']);
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Notice::note('unknown supervisor: '.$options['code'], 'r', 1);
|
Notice::note('without debug process sleeps for '.$options['sleep'].'sec', 'g');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Notice::note('unknown supervisor: '.self::$code, 'r', 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ class Supervisorctl
|
|||||||
{
|
{
|
||||||
$processend = microtime(true);
|
$processend = microtime(true);
|
||||||
$runtime = round(($processend - self::$starttime) / 60, 3);
|
$runtime = round(($processend - self::$starttime) / 60, 3);
|
||||||
Supervisor::where('code', self::$code)->update(['runtime' => $runtime, 'events' => self::$events]);
|
Supervisor::where('id', self::$code)->update(['runtime' => $runtime, 'events' => self::$events]);
|
||||||
if ($options['d']) {
|
if ($options['d']) {
|
||||||
Notice::note('spervisor time: '.$runtime.' min', 'g');
|
Notice::note('spervisor time: '.$runtime.' min', 'g');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
{"@attributes":{"time":"2025-08-27T09:16:03+00:00","timestamp":"1756286163"},"match":[{"@attributes":{"id":"14206418","xsid":"0","gsmid":"0","last_updated":"2025-08-27T04:01:22+00:00"},"time":"2025-08-27T00:00:00+00:00","group":{"@attributes":{"id":"176385","cgid":"613","spid":"1","cnid":"389","mgid":"1100","cname":"Copa Colombia"},"@text":"FBCOL Copa Colombia-25"},"hteam":{"@attributes":{"id":"7300"},"@text":"Deportivo Pereira"},"ateam":{"@attributes":{"id":"1748701"},"@text":"Real Cundinamarca"},"results":{"status":{"@attributes":{"last_updated":"2025-08-27T04:01:22+00:00","minute":"-1"},"@text":"Fin"},"result":[{"@attributes":{"id":"1","name":"CURRENT","value":"4-3"}},{"@attributes":{"id":"2","name":"FT","value":"4-3"}},{"@attributes":{"id":"3","name":"HT","value":"2-2"}}],"periods":{"period":[{"@attributes":{"id":"1","name":"1HF"},"detail":{"@attributes":{"name":"SCORE","value":"2-2"}}},{"@attributes":{"id":"2","name":"2HF"},"detail":{"@attributes":{"name":"SCORE","value":"2-1"}}},{"@attributes":{"id":"3","name":"ET"},"detail":{"@attributes":{"name":"SCORE","value":""}}},{"@attributes":{"id":"4","name":"PEN"},"detail":{"@attributes":{"name":"SCORE","value":""}}}]}}},{"@attributes":{"id":"14219467","xsid":"0","gsmid":"0","last_updated":"2025-08-27T04:01:19+00:00"},"time":"2025-08-27T00:00:00+00:00","group":{"@attributes":{"id":"174073","cgid":"1459","spid":"1","cnid":"409","mgid":"1009","cname":"CBF Brasileiro U20"},"@text":"FBBRA CBF Brasileiro U20-25"},"hteam":{"@attributes":{"id":"67272"},"@text":"Palmeiras SP U20"},"ateam":{"@attributes":{"id":"91468"},"@text":"RB Bragantino U20"},"results":{"status":{"@attributes":{"last_updated":"2025-08-27T04:01:17+00:00","minute":"-1"},"@text":"Fin"},"result":{"@attributes":{"id":"1","name":"CURRENT","value":""}}}},{"@attributes":{"id":"14221015","xsid":"0","gsmid":"0","last_updated":"2025-08-27T04:01:19+00:00"},"time":"2025-08-27T00:00:00+00:00","group":{"@attributes":{"id":"178055","cgid":"1150","spid":"1","cnid":"477","mgid":"1183","cname":"Copa Costa Rica"},"@text":"FBCRI Copa Costa Rica-25"},"hteam":{"@attributes":{"id":"9458"},"@text":"Carmelita"},"ateam":{"@attributes":{"id":"1971266"},"@text":"Inter San Carlos"},"results":{"status":{"@attributes":{"last_updated":"2025-08-27T04:01:19+00:00","minute":"-1"},"@text":"Fin"},"result":[{"@attributes":{"id":"1","name":"CURRENT","value":"2-0"}},{"@attributes":{"id":"2","name":"FT","value":"2-0"}},{"@attributes":{"id":"3","name":"HT","value":"1-0"}}],"periods":{"period":[{"@attributes":{"id":"1","name":"1HF"},"detail":{"@attributes":{"name":"SCORE","value":"1-0"}}},{"@attributes":{"id":"2","name":"2HF"},"detail":{"@attributes":{"name":"SCORE","value":"1-0"}}},{"@attributes":{"id":"3","name":"ET"},"detail":{"@attributes":{"name":"SCORE","value":""}}},{"@attributes":{"id":"4","name":"PEN"},"detail":{"@attributes":{"name":"SCORE","value":""}}}]}}},{"@attributes":{"id":"14228363","xsid":"0","gsmid":"0","last_updated":"2025-08-27T03:00:26+00:00"},"time":"2025-08-27T00:00:00+00:00","group":{"@attributes":{"id":"178551","cgid":"704","spid":"1","cnid":"528","mgid":"1189","cname":"CONCACAF Caribbean Cup"},"@text":"FBNACUP CONCACAF Caribbean Cup-25"},"hteam":{"@attributes":{"id":"59552"},"@text":"Weymouth Wales"},"ateam":{"@attributes":{"id":"241190"},"@text":"Cibao"},"results":{"status":{"@attributes":{"last_updated":"2025-08-27T03:00:26+00:00","minute":"-1"},"@text":"Sched"},"result":[{"@attributes":{"id":"1","name":"CURRENT","value":"1-2"}},{"@attributes":{"id":"2","name":"FT","value":"1-2"}},{"@attributes":{"id":"3","name":"HT","value":"0-2"}}],"periods":{"period":[{"@attributes":{"id":"1","name":"1HF"},"detail":{"@attributes":{"name":"SCORE","value":"0-2"}}},{"@attributes":{"id":"2","name":"2HF"},"detail":{"@attributes":{"name":"SCORE","value":"1-0"}}},{"@attributes":{"id":"3","name":"ET"},"detail":{"@attributes":{"name":"SCORE","value":""}}},{"@attributes":{"id":"4","name":"PEN"},"detail":{"@attributes":{"name":"SCORE","value":""}}}]}}},{"@attributes":{"id":"14236868","xsid":"0","gsmid":"0","last_updated":"2025-08-27T03:00:26+00:00"},"time":"2025-08-27T00:00:00+00:00","group":{"@attributes":{"id":"174829","cgid":"1857","spid":"1","cnid":"409","mgid":"1357","cname":"Brasileiro Feminino A2"},"@text":"WFBBRA Brasileiro Feminino A2-25"},"hteam":{"@attributes":{"id":"188666"},"@text":"Botafogo FR"},"ateam":{"@attributes":{"id":"52555"},"@text":"Santos"},"results":{"status":{"@attributes":{"last_updated":"2025-08-27T03:00:26+00:00","minute":"-1"},"@text":"Sched"},"result":[{"@attributes":{"id":"1","name":"CURRENT","value":"0-1"}},{"@attributes":{"id":"2","name":"FT","value":"0-1"}},{"@attributes":{"id":"3","name":"HT","value":"0-0"}}],"periods":{"period":[{"@attributes":{"id":"1","name":"1HF"},"detail":{"@attributes":{"name":"SCORE","value":"0-0"}}},{"@attributes":{"id":"2","name":"2HF"},"detail":{"@attributes":{"name":"SCORE","value":"0-1"}}},{"@attributes":{"id":"3","name":"ET"},"detail":{"@attributes":{"name":"SCORE","vaLine truncated
|
||||||
@@ -73,6 +73,7 @@ return [
|
|||||||
'unix_socket' => env('DB_SOCKET', ''),
|
'unix_socket' => env('DB_SOCKET', ''),
|
||||||
'charset' => env('DB_CHARSET', 'utf8mb4'),
|
'charset' => env('DB_CHARSET', 'utf8mb4'),
|
||||||
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
|
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
|
||||||
|
'timezone' => '+01:00',
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
'prefix_indexes' => true,
|
'prefix_indexes' => true,
|
||||||
'strict' => true,
|
'strict' => true,
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'betsapi_token' => env('BETSAPI_TOKEN', 'var missing in env'),
|
||||||
|
'txodds_token' => env('TXODDS_TOKEN', 'var missing in env'),
|
||||||
|
];
|
||||||
@@ -13,26 +13,22 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('events', function (Blueprint $table) {
|
Schema::create('events', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->timestamp('starttime')->nullable();
|
$table->dateTime('starttime')->nullable();
|
||||||
$table->integer('sport_id');
|
$table->integer('sport_id')->index();
|
||||||
$table->integer('provider_id')->default(0);
|
$table->integer('provider_id')->default(0)->index();
|
||||||
$table->integer('txodds_id')->default(0);
|
$table->integer('txodds_id')->default(0)->index();
|
||||||
$table->integer('betaid_id')->default(0);
|
$table->integer('betaid_id')->default(0)->index();
|
||||||
$table->integer('betradar_id')->default(0);
|
$table->integer('betradar_id')->default(0)->index();
|
||||||
$table->integer('country_id')->default(0);
|
|
||||||
$table->integer('group_id')->default(0);
|
$table->integer('magnig_id')->default(0)->index();
|
||||||
$table->integer('home_id')->default(0);
|
$table->integer('magken_id')->default(0)->index();
|
||||||
$table->integer('away_id')->default(0);
|
$table->integer('lognig_id')->default(0)->index();
|
||||||
|
$table->integer('logcol_id')->default(0)->index();
|
||||||
|
|
||||||
|
$table->integer('liga_id')->default(0)->index();
|
||||||
|
$table->integer('home_id')->default(0)->index();
|
||||||
|
$table->integer('away_id')->default(0)->index();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->index(['sport_id']);
|
|
||||||
$table->index(['provider_id']);
|
|
||||||
$table->index(['txodds_id']);
|
|
||||||
$table->index(['betaid_id']);
|
|
||||||
$table->index(['betradar_id']);
|
|
||||||
$table->index(['country_id']);
|
|
||||||
$table->index(['group_id']);
|
|
||||||
$table->index(['home_id']);
|
|
||||||
$table->index(['away_id']);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-6
@@ -11,14 +11,15 @@ return new class extends Migration
|
|||||||
*/
|
*/
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('groups', function (Blueprint $table) {
|
Schema::create('elements', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->integer('sport_id');
|
$table->integer('sport_id')->index();
|
||||||
$table->integer('country_id')->default(0);
|
$table->integer('txodds_id')->default(0)->index();
|
||||||
|
$table->integer('betsapi_id')->default(0)->index();
|
||||||
|
$table->integer('mag_id')->default(0)->index();
|
||||||
|
$table->integer('log_id')->default(0)->index();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->index(['sport_id']);
|
|
||||||
$table->index(['country_id']);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,6 +28,6 @@ return new class extends Migration
|
|||||||
*/
|
*/
|
||||||
public function down(): void
|
public function down(): void
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('groups');
|
Schema::dropIfExists('elements');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
+8
-6
@@ -11,14 +11,16 @@ return new class extends Migration
|
|||||||
*/
|
*/
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('group_filters', function (Blueprint $table) {
|
Schema::create('ligas', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->integer('sport_id');
|
$table->integer('sport_id')->index();
|
||||||
$table->integer('provider_id')->default(0);
|
$table->integer('country_id')->default(0)->index();
|
||||||
|
$table->integer('txodds_id')->default(0)->index();
|
||||||
|
$table->integer('betsapi_id')->default(0)->index();
|
||||||
|
$table->integer('mag_id')->default(0)->index();
|
||||||
|
$table->integer('log_id')->default(0)->index();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->index(['sport_id']);
|
|
||||||
$table->index(['provider_id']);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,6 +29,6 @@ return new class extends Migration
|
|||||||
*/
|
*/
|
||||||
public function down(): void
|
public function down(): void
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('group_filters');
|
Schema::dropIfExists('ligas');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
File renamed without changes.
@@ -17,7 +17,7 @@ return new class extends Migration
|
|||||||
$table->integer('sport_id')->default(0);
|
$table->integer('sport_id')->default(0);
|
||||||
$table->integer('matchpart_id')->default(0);
|
$table->integer('matchpart_id')->default(0);
|
||||||
$table->integer('bookmaker_id')->default(0);
|
$table->integer('bookmaker_id')->default(0);
|
||||||
$table->integer('provider_id')->default(0);
|
$table->integer('offer_id')->default(0);
|
||||||
$table->decimal('home', 7, 3)->default(0);
|
$table->decimal('home', 7, 3)->default(0);
|
||||||
$table->decimal('draw', 7, 3)->default(0);
|
$table->decimal('draw', 7, 3)->default(0);
|
||||||
$table->decimal('away', 7, 3)->default(0);
|
$table->decimal('away', 7, 3)->default(0);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ return new class extends Migration
|
|||||||
$table->integer('sport_id')->default(0);
|
$table->integer('sport_id')->default(0);
|
||||||
$table->integer('matchpart_id')->default(0);
|
$table->integer('matchpart_id')->default(0);
|
||||||
$table->integer('bookmaker_id')->default(0);
|
$table->integer('bookmaker_id')->default(0);
|
||||||
$table->integer('provider_id')->default(0);
|
$table->integer('offer_id')->default(0);
|
||||||
$table->decimal('home', 7, 3)->default(0);
|
$table->decimal('home', 7, 3)->default(0);
|
||||||
$table->decimal('away', 7, 3)->default(0);
|
$table->decimal('away', 7, 3)->default(0);
|
||||||
$table->decimal('margin', 7, 3)->default(0);
|
$table->decimal('margin', 7, 3)->default(0);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ return new class extends Migration
|
|||||||
$table->integer('sport_id')->default(0);
|
$table->integer('sport_id')->default(0);
|
||||||
$table->integer('matchpart_id')->default(0);
|
$table->integer('matchpart_id')->default(0);
|
||||||
$table->integer('bookmaker_id')->default(0);
|
$table->integer('bookmaker_id')->default(0);
|
||||||
$table->integer('provider_id')->default(0);
|
$table->integer('offer_id')->default(0);
|
||||||
$table->decimal('dc1x', 7, 3)->default(0);
|
$table->decimal('dc1x', 7, 3)->default(0);
|
||||||
$table->decimal('dc12', 7, 3)->default(0);
|
$table->decimal('dc12', 7, 3)->default(0);
|
||||||
$table->decimal('dc2x', 7, 3)->default(0);
|
$table->decimal('dc2x', 7, 3)->default(0);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ return new class extends Migration
|
|||||||
$table->integer('sport_id')->default(0);
|
$table->integer('sport_id')->default(0);
|
||||||
$table->integer('matchpart_id')->default(0);
|
$table->integer('matchpart_id')->default(0);
|
||||||
$table->integer('bookmaker_id')->default(0);
|
$table->integer('bookmaker_id')->default(0);
|
||||||
$table->integer('provider_id')->default(0);
|
$table->integer('offer_id')->default(0);
|
||||||
$table->decimal('dnb1', 7, 3)->default(0);
|
$table->decimal('dnb1', 7, 3)->default(0);
|
||||||
$table->decimal('dnb2', 7, 3)->default(0);
|
$table->decimal('dnb2', 7, 3)->default(0);
|
||||||
$table->decimal('margin', 7, 3)->default(0);
|
$table->decimal('margin', 7, 3)->default(0);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ return new class extends Migration
|
|||||||
$table->integer('sport_id')->default(0);
|
$table->integer('sport_id')->default(0);
|
||||||
$table->integer('matchpart_id')->default(0);
|
$table->integer('matchpart_id')->default(0);
|
||||||
$table->integer('bookmaker_id')->default(0);
|
$table->integer('bookmaker_id')->default(0);
|
||||||
$table->integer('provider_id')->default(0);
|
$table->integer('offer_id')->default(0);
|
||||||
$table->decimal('gg', 7, 3)->default(0);
|
$table->decimal('gg', 7, 3)->default(0);
|
||||||
$table->decimal('ng', 7, 3)->default(0);
|
$table->decimal('ng', 7, 3)->default(0);
|
||||||
$table->decimal('margin', 7, 3)->default(0);
|
$table->decimal('margin', 7, 3)->default(0);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ return new class extends Migration
|
|||||||
$table->integer('sport_id')->default(0);
|
$table->integer('sport_id')->default(0);
|
||||||
$table->integer('matchpart_id')->default(0);
|
$table->integer('matchpart_id')->default(0);
|
||||||
$table->integer('bookmaker_id')->default(0);
|
$table->integer('bookmaker_id')->default(0);
|
||||||
$table->integer('provider_id')->default(0);
|
$table->integer('offer_id')->default(0);
|
||||||
$table->decimal('htq', 7, 3)->default(0);
|
$table->decimal('htq', 7, 3)->default(0);
|
||||||
$table->decimal('atq', 7, 3)->default(0);
|
$table->decimal('atq', 7, 3)->default(0);
|
||||||
$table->decimal('margin', 7, 3)->default(0);
|
$table->decimal('margin', 7, 3)->default(0);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ return new class extends Migration
|
|||||||
$table->integer('sport_id')->default(0);
|
$table->integer('sport_id')->default(0);
|
||||||
$table->integer('matchpart_id')->default(0);
|
$table->integer('matchpart_id')->default(0);
|
||||||
$table->integer('bookmaker_id')->default(0);
|
$table->integer('bookmaker_id')->default(0);
|
||||||
$table->integer('provider_id')->default(0);
|
$table->integer('offer_id')->default(0);
|
||||||
$table->decimal('home', 7, 3)->default(0);
|
$table->decimal('home', 7, 3)->default(0);
|
||||||
$table->decimal('away', 7, 3)->default(0);
|
$table->decimal('away', 7, 3)->default(0);
|
||||||
$table->decimal('handicap', 7, 3)->default(0);
|
$table->decimal('handicap', 7, 3)->default(0);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ return new class extends Migration
|
|||||||
$table->integer('sport_id')->default(0);
|
$table->integer('sport_id')->default(0);
|
||||||
$table->integer('matchpart_id')->default(0);
|
$table->integer('matchpart_id')->default(0);
|
||||||
$table->integer('bookmaker_id')->default(0);
|
$table->integer('bookmaker_id')->default(0);
|
||||||
$table->integer('provider_id')->default(0);
|
$table->integer('offer_id')->default(0);
|
||||||
$table->decimal('over', 7, 3)->default(0);
|
$table->decimal('over', 7, 3)->default(0);
|
||||||
$table->decimal('under', 7, 3)->default(0);
|
$table->decimal('under', 7, 3)->default(0);
|
||||||
$table->decimal('total', 7, 3)->default(0);
|
$table->decimal('total', 7, 3)->default(0);
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ class OtherSeeder extends Seeder
|
|||||||
{
|
{
|
||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Provoider
|
||||||
|
*/
|
||||||
$sql = "INSERT INTO `providers` (`id`, `name`)
|
$sql = "INSERT INTO `providers` (`id`, `name`)
|
||||||
VALUES
|
VALUES
|
||||||
('1', 'TxOdds'),
|
('1', 'TxOdds'),
|
||||||
@@ -17,10 +20,22 @@ class OtherSeeder extends Seeder
|
|||||||
";
|
";
|
||||||
DB::unprepared($sql);
|
DB::unprepared($sql);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clients
|
||||||
|
*/
|
||||||
$sql = "INSERT INTO `clients` (`id`, `name`, `homepage`, `bookmaker`, `sport`, `created_at`, `updated_at`)
|
$sql = "INSERT INTO `clients` (`id`, `name`, `homepage`, `bookmaker`, `sport`, `created_at`, `updated_at`)
|
||||||
VALUES
|
VALUES
|
||||||
('1', 'Magloo', NULL, '[\"20\",\"24\"]', '[\"1\",\"3\"]', '2025-08-24 05:56:41', '2025-08-24 05:56:41'),
|
('1', 'Magloo', NULL, '[\"20\",\"24\"]', '[\"1\",\"3\"]', '2025-08-24 05:56:41', '2025-08-24 05:56:41'),
|
||||||
('2', 'Logifuture', NULL, '[\"26\",\"27\"]', '[\"1\",\"2\",\"3\",\"5\"]', '2025-08-24 05:57:01', '2025-08-24 05:57:01');";
|
('2', 'Logifuture', NULL, '[\"26\",\"27\"]', '[\"1\",\"2\",\"3\",\"5\"]', '2025-08-24 05:57:01', '2025-08-24 05:57:01');";
|
||||||
DB::unprepared($sql);
|
DB::unprepared($sql);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Supervisor
|
||||||
|
*/
|
||||||
|
$sql = "INSERT INTO `supervisors` (`id`, `name`, `type`, `provider_id`, `sport_id`, `bookmaker_id`, `sleep`, `limit`, `runtime`, `events`, `lastcall`, `is_cron`, `is_active`, `created_at`, `updated_at`)
|
||||||
|
VALUES
|
||||||
|
('1', 'Fixtures Soccer', 'Grapper', '1', '1', NULL, '10', '0', NULL, '0', '0', '1', '0', '2025-08-27 07:39:55', '2025-08-27 07:39:55');";
|
||||||
|
DB::unprepared($sql);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user