wip pp
This commit is contained in:
1 parent
f9c0c5aec5
commit
e0c1baf849
6 files changed
+32
-22
No files matched your search
@@ -8,7 +8,7 @@ class BoxNames
|
||||
{
|
||||
return [
|
||||
2 => 'DL',
|
||||
4 => 'MR',
|
||||
4 => 'ML',
|
||||
6 => 'LW',
|
||||
9 => 'DC',
|
||||
10 => 'DM',
|
||||
@@ -26,7 +26,7 @@ class BoxNames
|
||||
25 => 'MC',
|
||||
26 => 'AM',
|
||||
30 => 'DR',
|
||||
32 => 'ML',
|
||||
32 => 'MR',
|
||||
34 => 'RW',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ use App\Models\SofaScorePlayerPosition;
|
||||
use App\Models\SofaScoreRosa;
|
||||
use App\Models\SsLineupMemory;
|
||||
use App\Models\StatisticFixtures;
|
||||
use App\Models\StatistikoDetail;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Widgets\Widget;
|
||||
use Illuminate\Support\Collection;
|
||||
@@ -390,7 +391,9 @@ class PlayerPropsDrop extends Widget
|
||||
$team_home_away = 'away';
|
||||
}
|
||||
|
||||
$player_totals = SofaScorePlayerPerSeason::with('details')->where('total_min', '>', 0)->where('season', 'total')->where('ss_team_id', $team_id)->get();
|
||||
$team_player_ids = StatistikoDetail::where('ss_team_id', $team_id)->pluck('ss_player_id')->toArray();
|
||||
|
||||
$player_totals = SofaScorePlayerPerSeason::with('details')->where('season', 'total')->whereIn('ss_player_id', $team_player_ids)->get();
|
||||
|
||||
$count_player = 0;
|
||||
$tmp = [];
|
||||
@@ -682,7 +685,9 @@ class PlayerPropsDrop extends Widget
|
||||
|
||||
public function prepareLineUp()
|
||||
{
|
||||
$players = SofaScorePlayerPerSeason::with('details')->where('total_min', '>', 0)->where('season', 'last_180_days')->where('ss_team_id', $this->team_id)->get();
|
||||
$team_player_ids = StatistikoDetail::where('ss_team_id', $this->team_id)->pluck('ss_player_id')->toArray();
|
||||
|
||||
$players = SofaScorePlayerPerSeason::with('details')->where('season', 'last_180_days')->whereIn('ss_player_id', $team_player_ids)->get();
|
||||
|
||||
$arr = collect();
|
||||
foreach ($players as $value) {
|
||||
@@ -809,7 +814,8 @@ class PlayerPropsDrop extends Widget
|
||||
|
||||
public function getPlayerForPosition(array &$lineup, array &$id_used, int $place, Collection $players)
|
||||
{
|
||||
$log = false;
|
||||
$log = 0;
|
||||
|
||||
$position = $this->activeBoxes[$place];
|
||||
|
||||
$hirarchy = PositionHirarchie::load();
|
||||
@@ -830,7 +836,7 @@ class PlayerPropsDrop extends Widget
|
||||
$fitered = $players->where('pos', $position2)->whereNotIn('id', $id_used)->sortByDesc('min')->first();
|
||||
|
||||
if (isset($fitered['id'])) {
|
||||
$lineup[$fitered['id']] = ['id' => $fitered['id'], 'min' => $fitered['min'], 'place' => $place, 'position' => $position2];
|
||||
$lineup[$fitered['id']] = ['id' => $fitered['id'], 'min' => $fitered['min'], 'place' => $place, 'position' => $position];
|
||||
$id_used[] = $fitered['id'];
|
||||
if ($log) {
|
||||
Log::debug("B $place - $position $position2", $fitered);
|
||||
@@ -845,7 +851,7 @@ class PlayerPropsDrop extends Widget
|
||||
Log::debug("C $place - $position $position2 $position3", $fitered);
|
||||
}
|
||||
|
||||
$lineup[$fitered['id']] = ['id' => $fitered['id'], 'min' => $fitered['min'], 'place' => $place, 'position' => $position3];
|
||||
$lineup[$fitered['id']] = ['id' => $fitered['id'], 'min' => $fitered['min'], 'place' => $place, 'position' => $position];
|
||||
$id_used[] = $fitered['id'];
|
||||
} elseif (isset($hirarchy[$position][2])) {
|
||||
$position4 = $hirarchy[$position][2];
|
||||
@@ -856,7 +862,7 @@ class PlayerPropsDrop extends Widget
|
||||
Log::debug("D $place - $position $position2 $position3 $position4", $fitered);
|
||||
}
|
||||
|
||||
$lineup[$fitered['id']] = ['id' => $fitered['id'], 'min' => $fitered['min'], 'place' => $place, 'position' => $position4];
|
||||
$lineup[$fitered['id']] = ['id' => $fitered['id'], 'min' => $fitered['min'], 'place' => $place, 'position' => $position];
|
||||
$id_used[] = $fitered['id'];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user