This commit is contained in:
salam committed 2026-08-29 16:35:38 +02:00
1 parent 8f6beac89b
commit 82f3654a05
5 files changed
+16 -12

No files matched your search

+2
View File
@@ -20,6 +20,7 @@ class PlayerPerSeason
foreach ($res2 as $val2) { foreach ($res2 as $val2) {
if (isset($val2->event->season)) {
if (!isset($collection[$val2->event->season])) { if (!isset($collection[$val2->event->season])) {
$collection[$val2->event->season]['events_played_home'] = 0; $collection[$val2->event->season]['events_played_home'] = 0;
$collection[$val2->event->season]['events_played_away'] = 0; $collection[$val2->event->season]['events_played_away'] = 0;
@@ -39,6 +40,7 @@ class PlayerPerSeason
} }
} }
} }
}
foreach ($collection as $season => $row) { foreach ($collection as $season => $row) {
if ($val->ss_team_id && $val->ss_player_id) { if ($val->ss_team_id && $val->ss_player_id) {
+8 -6
View File
@@ -13,15 +13,15 @@ class LoadPlayer
{ {
$team_id = $get('team_id'); $team_id = $get('team_id');
$season = $get('season'); // $season = $get('season');
$team_position = $get('team_position'); $team_position = $get('team_position');
$season_or_date = $filter['season_or_date'] ?? 'season'; // $season_or_date = $filter['season_or_date'] ?? 'season';
if ($season_or_date != 'season' or !count($season)) { // if ($season_or_date != 'season' or !count($season)) {
$season[] = date('Y'); // $season[] = date('Y');
} // }
$matches = StatistikoEvent::where(function ($query) use ($team_id, $team_position) { $matches = StatistikoEvent::where(function ($query) use ($team_id, $team_position) {
switch ($team_position) { switch ($team_position) {
@@ -43,7 +43,9 @@ class LoadPlayer
$positions_map = LoadPositions::load(); $positions_map = LoadPositions::load();
// needs to run daily for pre-calculaton // needs to run daily for pre-calculaton
$player = SofaScorePlayerPerSeason::with('details')->where('ss_team_id', $team_id)->whereIn('season', $season)->get(); $player = SofaScorePlayerPerSeason::with('details')->where('ss_team_id', $team_id)->get();
// dd($player);
$arr = []; $arr = [];
foreach ($player as $val) { foreach ($player as $val) {
@@ -130,6 +130,7 @@ class LoadEventsQuery
$arr = []; $arr = [];
foreach ($res as $value) { foreach ($res as $value) {
$tmp = []; $tmp = [];
$tmp['match_id'] = $value->match_id; $tmp['match_id'] = $value->match_id;
$tmp['sport_id'] = $value->sport_id; $tmp['sport_id'] = $value->sport_id;
@@ -143,8 +144,8 @@ class LoadEventsQuery
$tmp['exp_handicap'] = $value->exp_handicap; $tmp['exp_handicap'] = $value->exp_handicap;
$tmp['exp_total'] = $value->exp_total; $tmp['exp_total'] = $value->exp_total;
$tmp['result_code'] = $value->result_code; $tmp['result_code'] = $value->result_code;
$tmp['home'] = $value->home->ss_team_name; $tmp['home'] = $value->home->ss_team_name ?? 0;
$tmp['away'] = $value->away->ss_team_name; $tmp['away'] = $value->away->ss_team_name ?? 0;
switch ($statistic_type) { switch ($statistic_type) {
case 'gls': case 'gls':
+2 -3
View File
@@ -24,9 +24,6 @@ class LoadPlayer
$ss_player_id = (int) $filter['ss_player_id'] ?? 0; $ss_player_id = (int) $filter['ss_player_id'] ?? 0;
$start = $filter['start_date'] ?? 0;
$end = $filter['end_date'] ?? 0;
$statistic_type = $filter['statistic_type'] ?? 'gls'; $statistic_type = $filter['statistic_type'] ?? 'gls';
@@ -50,6 +47,8 @@ class LoadPlayer
$res = StatistikoPlayer::with('event')->where('ss_player_id', (int) $ss_player_id)->get(); $res = StatistikoPlayer::with('event')->where('ss_player_id', (int) $ss_player_id)->get();
// dd($res);
$tmp = []; $tmp = [];
foreach ($res as $value) { foreach ($res as $value) {
@@ -18,7 +18,7 @@ return new class extends Migration
$table->integer('country_id')->default(0)->nullable()->index()->references('id')->on('countries'); $table->integer('country_id')->default(0)->nullable()->index()->references('id')->on('countries');
$table->integer('ss_team_id')->index(); $table->integer('ss_team_id')->index();
$table->string('ss_team_name'); $table->string('ss_team_name');
$table->string('slug'); $table->string('slug')->nullable();
$table->boolean('is_active')->default(false); $table->boolean('is_active')->default(false);
$table->boolean('disabled')->default(false); $table->boolean('disabled')->default(false);
$table->boolean('grapped')->default(false); $table->boolean('grapped')->default(false);