wip countries
This commit is contained in:
1 parent
7116d3c576
commit
8d623755ca
12 files changed
+27053
-97
No files matched your search
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\TxOdds;
|
||||
namespace App\Console\Commands\Grapper\TxOdds\Fixtures;
|
||||
|
||||
use App\Models\Element;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\TxOdds;
|
||||
namespace App\Console\Commands\Grapper\TxOdds\Fixtures;
|
||||
|
||||
use App\Console\Commands\NuhBash;
|
||||
use App\Models\Country;
|
||||
|
||||
@@ -3,8 +3,11 @@
|
||||
namespace App\Console\Commands\Grapper\TxOdds;
|
||||
|
||||
use App\Console\Commands\Curl;
|
||||
use App\Console\Commands\Grapper\TxOdds\Fixtures\TxElement;
|
||||
use App\Console\Commands\Grapper\TxOdds\Fixtures\TxLigas;
|
||||
use App\Console\Commands\NuhBash;
|
||||
use App\Models\Event;
|
||||
use App\Utilities\Notice;
|
||||
|
||||
class FixturesSoccer
|
||||
{
|
||||
@@ -20,8 +23,9 @@ class FixturesSoccer
|
||||
|
||||
$data = Curl::load($url, $debug);
|
||||
|
||||
$i = 0;
|
||||
foreach ($data['match'] as $row) {
|
||||
|
||||
$i++;
|
||||
$txodds_id = array_column($row, 'id');
|
||||
$spid = array_column($row['group'], 'spid');
|
||||
$liga_id = TxLigas::find($row['group']);
|
||||
@@ -37,9 +41,9 @@ class FixturesSoccer
|
||||
'home_id' => $home_id,
|
||||
'away_id' => $away_id,
|
||||
]);
|
||||
|
||||
dd($event);
|
||||
// dd($event);
|
||||
}
|
||||
Notice::note("$i events processed", 'g');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,11 @@ class EventsTable
|
||||
return $record->sport->icon;
|
||||
}),
|
||||
TextColumn::make('starttime')->dateTime('M j, Y H:i')->sortable(),
|
||||
IconColumn::make('liga')
|
||||
->label('')
|
||||
->icon(function ($record): string {
|
||||
return 'flag-country-'.$record->liga->country->iso2;
|
||||
}),
|
||||
TextColumn::make('liga.name')->searchable(),
|
||||
TextColumn::make('home.name')->searchable(),
|
||||
TextColumn::make('away.name')->searchable(),
|
||||
|
||||
+1
-13
@@ -4,16 +4,4 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Country extends Model
|
||||
{
|
||||
protected $table = 'countries';
|
||||
|
||||
protected $primaryKey = 'cc';
|
||||
|
||||
public $incrementing = false;
|
||||
|
||||
public function ligas()
|
||||
{
|
||||
return $this->hasMany(Liga::class, 'cc', 'cc');
|
||||
}
|
||||
}
|
||||
class Country extends Model {}
|
||||
@@ -12,4 +12,9 @@ class Liga extends Model
|
||||
'country_id',
|
||||
'txodds_id',
|
||||
];
|
||||
|
||||
public function country()
|
||||
{
|
||||
return $this->belongsTo(Country::class);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user