This commit is contained in:
salam committed 2026-09-14 21:49:59 +02:00
1 parent 2a54730e60
commit a8ce52d034
1 file changed
+7 -9
+7 -9
View File
@@ -8,7 +8,6 @@ use App\Models\SofaScorePlayerPosition;
use App\Models\SofaScoreRosa; use App\Models\SofaScoreRosa;
use App\Models\SsLineupMemory; use App\Models\SsLineupMemory;
use App\Models\StatisticFixtures; use App\Models\StatisticFixtures;
use App\Models\StatistikoDetail;
use Filament\Notifications\Notification; use Filament\Notifications\Notification;
use Filament\Widgets\Widget; use Filament\Widgets\Widget;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
@@ -345,11 +344,11 @@ class PlayerPropsDrop extends Widget
$asp_team = (float) $res->exp_away; $asp_team = (float) $res->exp_away;
} }
$player = StatistikoDetail::where('ss_team_id', (int) $team_id)->where('is_active', 1)->get(); $player_totals = SofaScorePlayerPerSeason::with('details')->where('total_min', '>', 0)->where('season', 'total')->where('ss_team_id', $team_id)->get();
$count_player = 0; $count_player = 0;
foreach ($player as $key => $value) { foreach ($player_totals as $key => $value) {
if ($value['position'] != 'GK' and $value['is_active'] == 1) { if ($value->details->position != 'GK' && (int) $value->details->is_active != 0) {
$count_player++; $count_player++;
} }
} }
@@ -360,10 +359,6 @@ class PlayerPropsDrop extends Widget
$asp_team_riferimento = (float) $asp_team * $count_player / 10; $asp_team_riferimento = (float) $asp_team * $count_player / 10;
// dd($player->count(), $asp_team_riferimento);
$player_totals = SofaScorePlayerPerSeason::with('details')->where('season', 'total')->where('ss_team_id', $team_id)->get();
/*** /***
"id" => 35067 "id" => 35067
"ss_player_id" => 233856 "ss_player_id" => 233856
@@ -383,8 +378,11 @@ class PlayerPropsDrop extends Widget
"shots_on_target" => 1 "shots_on_target" => 1
"shots_off_target" => 0 "shots_off_target" => 0
*/ */
$results = []; $results = [];
$this->calculationVariables = []; $this->calculationVariables = [];
foreach ($player_totals as $val) { foreach ($player_totals as $val) {
if ($val->details && $val->details->is_active) { if ($val->details && $val->details->is_active) {
@@ -507,7 +505,7 @@ class PlayerPropsDrop extends Widget
} }
} }
Log::debug('results', $results); // Log::debug('results', $results);
$bettypes = ['goals', 'cards', 'fouls', 'offsides', 'total_shots', 'shots_on_target']; $bettypes = ['goals', 'cards', 'fouls', 'offsides', 'total_shots', 'shots_on_target'];
foreach ($bettypes as $bettype) { foreach ($bettypes as $bettype) {