wip
This commit is contained in:
1 parent
5779c071a5
commit
5cf6ec20dc
3 files changed
+30
-5
No files matched your search
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions\Selections;
|
||||
|
||||
use App\Models\StatistikoDetail;
|
||||
|
||||
class LoadPlayer
|
||||
{
|
||||
public static function load($team_id)
|
||||
{
|
||||
// $res = CompetitionGroup::with('country')->where('id', $league_id)->first();
|
||||
// $season_mode = $res->country->season_mode;
|
||||
|
||||
$res = StatistikoDetail::where('txodds_id', $team_id)->get();
|
||||
|
||||
if (! $res) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$arr = [];
|
||||
foreach ($res as $val) {
|
||||
$arr[$val->position][$val->tm_player_id] = $val->name;
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions;
|
||||
namespace App\Actions\Selections;
|
||||
|
||||
use App\Models\CompetitionGroup;
|
||||
use App\Models\StatisticFixtures;
|
||||
use App\Models\StatistikoEvent;
|
||||
|
||||
class LoadSeasons
|
||||
@@ -2,9 +2,10 @@
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Actions\LoadSeasons;
|
||||
use App\Actions\LoadStatisticFixturesLeaguesOptions;
|
||||
use App\Actions\LoadStatisticFixturesMatchOptions;
|
||||
use App\Actions\Selections\LoadPlayer;
|
||||
use App\Actions\Selections\LoadSeasons;
|
||||
use App\Models\Element;
|
||||
use App\Models\StatisticFixtures;
|
||||
use App\Models\StatistikoDetail;
|
||||
@@ -220,7 +221,7 @@ class Statistic extends BaseDashboard
|
||||
)
|
||||
->preload()
|
||||
->options(function (Get $get) {
|
||||
return StatistikoDetail::where('txodds_id', $get('team_id'))->pluck('name', 'tm_player_id');
|
||||
return LoadPlayer::load($get('team_id'));
|
||||
})
|
||||
->live(),
|
||||
Select::make('player_on_field')
|
||||
|
||||
Reference in new issue
Block a user