download odds
This commit is contained in:
1 parent
b60e7c2f99
commit
483b5e1abe
5 files changed
+347
-2
No files matched your search
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Exports;
|
||||
|
||||
use App\Models\Event;
|
||||
use Filament\Actions\Exports\ExportColumn;
|
||||
use Filament\Actions\Exports\Exporter;
|
||||
use Filament\Actions\Exports\Models\Export;
|
||||
use Illuminate\Support\Number;
|
||||
|
||||
class MainMarketsExporter extends Exporter
|
||||
{
|
||||
protected static ?string $model = Event::class;
|
||||
|
||||
public static function getColumns(): array
|
||||
{
|
||||
return [
|
||||
ExportColumn::make('id')
|
||||
->label('TxOdds id'),
|
||||
ExportColumn::make('betsapi_id'),
|
||||
ExportColumn::make('betradar_id'),
|
||||
ExportColumn::make('bet365_id'),
|
||||
ExportColumn::make('starttime'),
|
||||
ExportColumn::make('sport_id'),
|
||||
ExportColumn::make('country_id'),
|
||||
ExportColumn::make('country.name'),
|
||||
ExportColumn::make('competition_group_id')
|
||||
->label('Group id'),
|
||||
ExportColumn::make('competition_group.name')
|
||||
->label('Group'),
|
||||
ExportColumn::make('home_id'),
|
||||
ExportColumn::make('home.name'),
|
||||
ExportColumn::make('away_id'),
|
||||
ExportColumn::make('away.name'),
|
||||
ExportColumn::make('odds_3ways.bookmaker_id'),
|
||||
ExportColumn::make('odds_3ways.h3w'),
|
||||
ExportColumn::make('odds_3ways.h3w')
|
||||
->label('1'),
|
||||
ExportColumn::make('odds_3ways.d3w')
|
||||
->label('X'),
|
||||
ExportColumn::make('odds_3ways.a3w')
|
||||
->label('2'),
|
||||
ExportColumn::make('odds_totals.over')
|
||||
->label('Over'),
|
||||
ExportColumn::make('odds_totals.under')
|
||||
->label('Under'),
|
||||
ExportColumn::make('odds_totals.total')
|
||||
->label('Total'),
|
||||
];
|
||||
}
|
||||
|
||||
public static function getCompletedNotificationBody(Export $export): string
|
||||
{
|
||||
$body = 'Your event export has completed and '.Number::format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
|
||||
|
||||
if ($failedRowsCount = $export->getFailedRowsCount()) {
|
||||
$body .= ' '.Number::format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
|
||||
}
|
||||
|
||||
return $body;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user