wip
This commit is contained in:
1 parent
33e8107517
commit
2545542033
2 files changed
+27
-1
No files matched your search
+26
@@ -2,7 +2,12 @@
|
|||||||
|
|
||||||
namespace App\Filament\Clusters\StaticData\Resources\SofaScoreTournaments\Tables;
|
namespace App\Filament\Clusters\StaticData\Resources\SofaScoreTournaments\Tables;
|
||||||
|
|
||||||
|
use App\Models\SofaScoreRosa;
|
||||||
|
use App\Models\SofaScoreRosaTournament;
|
||||||
|
use App\Models\SofaScoreTournament;
|
||||||
|
use Filament\Actions\Action;
|
||||||
use Filament\Forms\Components\Toggle;
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use Filament\Notifications\Notification;
|
||||||
use Filament\Support\Enums\IconSize;
|
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;
|
||||||
@@ -18,6 +23,27 @@ class SofaScoreTournamentsTable
|
|||||||
public static function configure(Table $table): Table
|
public static function configure(Table $table): Table
|
||||||
{
|
{
|
||||||
return $table
|
return $table
|
||||||
|
->headerActions([
|
||||||
|
Action::make('update_rose_tornaments')
|
||||||
|
->label('Update Roosters')
|
||||||
|
->action(function () {
|
||||||
|
$res = SofaScoreTournament::whereNotNull('ss_liga_code')->where('ss_liga_code', '<>', '')->where('enabled', 1)->pluck('ss_liga_code', 'tournament_id');
|
||||||
|
foreach ($res as $tournament_id => $ss_liga_code) {
|
||||||
|
$rosa = SofaScoreRosa::where('cc', $ss_liga_code)->get();
|
||||||
|
foreach ($rosa as $team) {
|
||||||
|
SofaScoreRosaTournament::updateOrCreate(
|
||||||
|
['ss_team_id' => $team->ss_team_id, 'ss_tournament_id' => $tournament_id],
|
||||||
|
['grapped' => 0, 'disabled' => 0]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->successNotification(
|
||||||
|
Notification::make()
|
||||||
|
->success()
|
||||||
|
->title('Tournament Roosters table updated')
|
||||||
|
),
|
||||||
|
])
|
||||||
->columns([
|
->columns([
|
||||||
IconColumn::make('sport.icon')
|
IconColumn::make('sport.icon')
|
||||||
->label('')
|
->label('')
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ trait GrappingTeams
|
|||||||
|
|
||||||
if ($this->debug) {
|
if ($this->debug) {
|
||||||
$key++;
|
$key++;
|
||||||
Notice::note($key / $count.' - '.$value->ss_team_name);
|
Notice::note($key.'/'.$count.' - '.$value->ss_team_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = $this->base_url."api/v1/team/$value->ss_team_id/players";
|
$url = $this->base_url."api/v1/team/$value->ss_team_id/players";
|
||||||
|
|||||||
Reference in new issue
Block a user