wip
This commit is contained in:
1 parent
d1163b6692
commit
d4a4d0c5f1
5 files changed
+11
-3
No files matched your search
@@ -52,6 +52,7 @@ class ImportDetails
|
|||||||
'last_update',
|
'last_update',
|
||||||
'is_active',
|
'is_active',
|
||||||
'last_import',
|
'last_import',
|
||||||
|
'betradar_player_id',
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class ImportFixtures
|
|||||||
{
|
{
|
||||||
public static function run(string $filePath): void
|
public static function run(string $filePath): void
|
||||||
{
|
{
|
||||||
SimpleExcelReader::create(storage_path('app/public/' . $filePath))
|
SimpleExcelReader::create(storage_path('app/public/'.$filePath))
|
||||||
->getRows()
|
->getRows()
|
||||||
->chunk(200)
|
->chunk(200)
|
||||||
->each(function (LazyCollection $chunk) {
|
->each(function (LazyCollection $chunk) {
|
||||||
@@ -38,7 +38,11 @@ class ImportFixtures
|
|||||||
'away_id' => (int) $row[3],
|
'away_id' => (int) $row[3],
|
||||||
'starttime' => Carbon::parse($row[4])->toDateTimeString(),
|
'starttime' => Carbon::parse($row[4])->toDateTimeString(),
|
||||||
],
|
],
|
||||||
['exp_home' => (float) $row[5], 'exp_away' => (float) $row[6]]
|
[
|
||||||
|
'exp_home' => (float) $row[5],
|
||||||
|
'exp_away' => (float) $row[6],
|
||||||
|
'betradar_id' => (int) $row[9],
|
||||||
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ use Illuminate\Support\Carbon;
|
|||||||
class StatisticFixtures extends Model
|
class StatisticFixtures extends Model
|
||||||
{
|
{
|
||||||
use Prunable;
|
use Prunable;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
|
'betradar_id',
|
||||||
'sport_id',
|
'sport_id',
|
||||||
'league_id',
|
'league_id',
|
||||||
'home_id',
|
'home_id',
|
||||||
@@ -34,7 +36,6 @@ class StatisticFixtures extends Model
|
|||||||
return static::where('starttime', '<', Carbon::now('Europe/Vienna')->subMinutes(5));
|
return static::where('starttime', '<', Carbon::now('Europe/Vienna')->subMinutes(5));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function sport()
|
public function sport()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Sport::class)->where('is_active', 1);
|
return $this->belongsTo(Sport::class)->where('is_active', 1);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class StatistikoDetail extends Model
|
|||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'ss_player_id',
|
'ss_player_id',
|
||||||
'ss_team_id',
|
'ss_team_id',
|
||||||
|
'betradar_player_id',
|
||||||
'player_name',
|
'player_name',
|
||||||
'ss_national_team_id',
|
'ss_national_team_id',
|
||||||
'birthdate',
|
'birthdate',
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('statistic_fixtures', function (Blueprint $table) {
|
Schema::create('statistic_fixtures', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
|
$table->integer('betradar_id')->index();
|
||||||
$table->integer('sport_id')->index();
|
$table->integer('sport_id')->index();
|
||||||
$table->integer('league_id')->index();
|
$table->integer('league_id')->index();
|
||||||
$table->integer('home_id')->index();
|
$table->integer('home_id')->index();
|
||||||
|
|||||||
Reference in new issue
Block a user