wip order classes
This commit is contained in:
1 parent
fe4fa6e9cf
commit
7bf4258c4a
29 files changed
+110
-94
No files matched your search
+2
-1
@@ -1,8 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Data\LoadEvents;
|
||||
namespace App\Filament\Widgets\Boxes;
|
||||
|
||||
use App\Filament\Pages\Selections\Helper\GetSeason;
|
||||
use App\Filament\Widgets\Boxes\Helper\ExpectationAverage;
|
||||
use App\Models\StatistikoEvent;
|
||||
|
||||
class AverageLeagueSeason
|
||||
+2
-1
@@ -1,8 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Data\LoadEvents;
|
||||
namespace App\Filament\Widgets\Boxes;
|
||||
|
||||
use App\Filament\Pages\Selections\Helper\GetSeason;
|
||||
use App\Filament\Widgets\Boxes\Helper\ExpectationAverage;
|
||||
use App\Models\StatistikoEvent;
|
||||
|
||||
class AverageTeam
|
||||
+2
-1
@@ -1,8 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Data\LoadEvents;
|
||||
namespace App\Filament\Widgets\Boxes;
|
||||
|
||||
use App\Filament\Pages\Selections\Helper\GetSeason;
|
||||
use App\Filament\Widgets\Boxes\Helper\ExpectationAverage;
|
||||
use App\Models\StatistikoEvent;
|
||||
|
||||
class AverageTeamSeason
|
||||
+9
-46
@@ -1,42 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Data;
|
||||
namespace App\Filament\Widgets\Boxes;
|
||||
|
||||
use App\Filament\Widgets\Data\LoadEvents\AverageLeagueSeason;
|
||||
use App\Filament\Widgets\Data\LoadEvents\AverageTeam;
|
||||
use App\Filament\Widgets\Data\LoadEvents\AverageTeamSeason;
|
||||
use App\Filament\Widgets\Data\LoadEvents\ExpectationCalculation;
|
||||
use App\Filament\Widgets\Data\LoadEvents\ExpectationCollecting;
|
||||
use App\Filament\Widgets\Data\LoadEvents\LoadEventsQueryAll;
|
||||
use App\Models\StatisticFixtures;
|
||||
use App\Filament\Widgets\Boxes\Helper\ExpectationCalculation;
|
||||
use App\Filament\Widgets\Boxes\Helper\ExpectationCollecting;
|
||||
use App\Filament\Widgets\Charts\LoadEvents\LoadEventsQueryAll;
|
||||
use App\Utilities\Round;
|
||||
|
||||
class LoadEventsBoxes
|
||||
class ExpectationsTeam
|
||||
{
|
||||
public static function load(array $filter, bool $hasdots)
|
||||
public static function load(array &$expectations, array $filter, object $match)
|
||||
{
|
||||
/**
|
||||
* STATTISTIC DATA
|
||||
*/
|
||||
$league_id = (int) $filter['league_id'] ?? 0;
|
||||
$match_id = (int) $filter['match_id'] ?? 0;
|
||||
$team_id = (int) $filter['team_id'] ?? 0;
|
||||
$team_position = $filter['team_position'];
|
||||
$similar_past_matches = $filter['similar_past_matches'];
|
||||
|
||||
if (! $league_id) {
|
||||
return [];
|
||||
}
|
||||
if (! $match_id) {
|
||||
return [];
|
||||
}
|
||||
if (! $team_id) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$match = StatisticFixtures::with('home')->with('away')->where('id', (int) $match_id)->first();
|
||||
|
||||
if (! $match) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if ($similar_past_matches != 'none') {
|
||||
$team_id = 0;
|
||||
$team_position = '';
|
||||
@@ -47,9 +30,6 @@ class LoadEventsBoxes
|
||||
$away_team = 'Against';
|
||||
}
|
||||
|
||||
/**
|
||||
* STATTISTIC DATA
|
||||
*/
|
||||
$res = LoadEventsQueryAll::load($filter, $match);
|
||||
if (! $res) {
|
||||
return [];
|
||||
@@ -126,22 +106,5 @@ class LoadEventsBoxes
|
||||
$expectations['draw_odd'] = $expectations['draw_count'] ? number_format(Round::odd($count_events / $expectations['draw_count']), 2) : 0;
|
||||
$expectations['lost_odd'] = $expectations['lost_count'] ? number_format(Round::odd($count_events / $expectations['lost_count']), 2) : 0;
|
||||
$expectations['count_events'] = $count_events;
|
||||
|
||||
if ($team_id == $match->home_id) {
|
||||
$expectations['active_team'] = $match->home->ss_team_name;
|
||||
} else {
|
||||
$expectations['active_team'] = $match->away->ss_team_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* LEAGUE AVERAGES
|
||||
*/
|
||||
if ($team_id != 0 && $similar_past_matches == 'none') {
|
||||
AverageTeam::load($expectations, $filter);
|
||||
AverageTeamSeason::load($expectations, $filter);
|
||||
AverageLeagueSeason::load($expectations, $filter);
|
||||
}
|
||||
|
||||
return $expectations;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Data\LoadEvents;
|
||||
namespace App\Filament\Widgets\Boxes\Helper;
|
||||
|
||||
class ExpectationAverage
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Data\LoadEvents;
|
||||
namespace App\Filament\Widgets\Boxes\Helper;
|
||||
|
||||
use App\Models\StatistikoConfig;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Data\LoadEvents;
|
||||
namespace App\Filament\Widgets\Boxes\Helper;
|
||||
|
||||
class ExpectationCollecting
|
||||
{
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Boxes;
|
||||
|
||||
use App\Models\StatisticFixtures;
|
||||
|
||||
class LoadEventsBoxes
|
||||
{
|
||||
public static function load(array $filter, bool $hasdots)
|
||||
{
|
||||
$league_id = (int) $filter['league_id'] ?? 0;
|
||||
$match_id = (int) $filter['match_id'] ?? 0;
|
||||
$team_id = (int) $filter['team_id'] ?? 0;
|
||||
$team_position = $filter['team_position'];
|
||||
$similar_past_matches = $filter['similar_past_matches'];
|
||||
|
||||
if (! $league_id) {
|
||||
return [];
|
||||
}
|
||||
if (! $match_id) {
|
||||
return [];
|
||||
}
|
||||
if (! $team_id) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$match = StatisticFixtures::with('home')->with('away')->where('id', (int) $match_id)->first();
|
||||
|
||||
if (! $match) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$expectations = [];
|
||||
ExpectationsTeam::load($expectations, $filter, $match);
|
||||
|
||||
if ($team_id == $match->home_id) {
|
||||
$expectations['active_team'] = $match->home->ss_team_name;
|
||||
} else {
|
||||
$expectations['active_team'] = $match->away->ss_team_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* LEAGUE AVERAGES
|
||||
*/
|
||||
if ($team_id != 0 && $similar_past_matches == 'none') {
|
||||
AverageTeam::load($expectations, $filter);
|
||||
AverageTeamSeason::load($expectations, $filter);
|
||||
AverageLeagueSeason::load($expectations, $filter);
|
||||
}
|
||||
|
||||
return $expectations;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Widgets\Data\LoadEventsBoxes;
|
||||
use App\Filament\Widgets\Boxes\LoadEventsBoxes;
|
||||
use Filament\Widgets\Concerns\InteractsWithPageFilters;
|
||||
use Filament\Widgets\StatsOverviewWidget;
|
||||
use Filament\Widgets\StatsOverviewWidget\Stat;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Widgets\Data\HelperStatisticType;
|
||||
use App\Filament\Widgets\Data\LoadEvents;
|
||||
use App\Filament\Widgets\Charts\HelperStatisticType;
|
||||
use App\Filament\Widgets\Charts\LoadEvents;
|
||||
use App\Utilities\Round;
|
||||
use Filament\Widgets\Concerns\InteractsWithPageFilters;
|
||||
use Filament\Widgets\StatsOverviewWidget;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Widgets\Data\HelperStatisticType;
|
||||
use App\Filament\Widgets\Data\LoadEvents;
|
||||
use App\Filament\Widgets\Charts\HelperStatisticType;
|
||||
use App\Filament\Widgets\Charts\LoadEvents;
|
||||
use Filament\Support\RawJs;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Widgets\Data\HelperMoveingAverage;
|
||||
use App\Filament\Widgets\Data\HelperStatisticType;
|
||||
use App\Filament\Widgets\Data\LoadEvents;
|
||||
use App\Filament\Widgets\Charts\HelperMoveingAverage;
|
||||
use App\Filament\Widgets\Charts\HelperStatisticType;
|
||||
use App\Filament\Widgets\Charts\LoadEvents;
|
||||
use Filament\Support\RawJs;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Widgets\Data\LoadPerformance;
|
||||
use App\Filament\Widgets\Charts\LoadPerformance;
|
||||
use Filament\Support\RawJs;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Widgets\Data\HelperMoveingAveragePerformens;
|
||||
use App\Filament\Widgets\Data\LoadPerformance;
|
||||
use App\Filament\Widgets\Charts\HelperMoveingAveragePerformens;
|
||||
use App\Filament\Widgets\Charts\LoadPerformance;
|
||||
use Filament\Support\RawJs;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Widgets\Data\HelperStatisticType;
|
||||
use App\Filament\Widgets\Data\LoadPlayerWidgets;
|
||||
use App\Filament\Widgets\Charts\HelperStatisticType;
|
||||
use App\Filament\Widgets\Charts\LoadPlayerWidgets;
|
||||
use Filament\Support\RawJs;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Widgets\Data\HelperMoveingAverage;
|
||||
use App\Filament\Widgets\Data\HelperStatisticType;
|
||||
use App\Filament\Widgets\Data\LoadPlayerWidgets;
|
||||
use App\Filament\Widgets\Charts\HelperMoveingAverage;
|
||||
use App\Filament\Widgets\Charts\HelperStatisticType;
|
||||
use App\Filament\Widgets\Charts\LoadPlayerWidgets;
|
||||
use Filament\Support\RawJs;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Widgets\Data\LoadPlayerPerformance;
|
||||
use App\Filament\Widgets\Charts\LoadPlayerPerformance;
|
||||
use Filament\Support\RawJs;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Widgets\Data\HelperMoveingAverage;
|
||||
use App\Filament\Widgets\Data\LoadPlayerPerformance;
|
||||
use App\Filament\Widgets\Charts\HelperMoveingAverage;
|
||||
use App\Filament\Widgets\Charts\LoadPlayerPerformance;
|
||||
use Filament\Support\RawJs;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Data;
|
||||
namespace App\Filament\Widgets\Charts;
|
||||
|
||||
class HelperMoveingAverage
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Data;
|
||||
namespace App\Filament\Widgets\Charts;
|
||||
|
||||
class HelperMoveingAveragePerformens
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Data;
|
||||
namespace App\Filament\Widgets\Charts;
|
||||
|
||||
class HelperStatisticType
|
||||
{
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Data;
|
||||
namespace App\Filament\Widgets\Charts;
|
||||
|
||||
use App\Filament\Widgets\Data\LoadEvents\LoadEventsAverages;
|
||||
use App\Filament\Widgets\Data\LoadEvents\LoadEventsQuery;
|
||||
use App\Filament\Widgets\Data\LoadEvents\LoadExpectations;
|
||||
use App\Filament\Widgets\Charts\LoadEvents\LoadEventsAverages;
|
||||
use App\Filament\Widgets\Charts\LoadEvents\LoadEventsQuery;
|
||||
use App\Filament\Widgets\Charts\LoadEvents\LoadExpectations;
|
||||
use App\Models\StatisticFixtures;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
+3
-5
@@ -1,10 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Data\LoadEvents;
|
||||
namespace App\Filament\Widgets\Charts\LoadEvents;
|
||||
|
||||
use App\Models\SofaScoreTournament;
|
||||
use App\Models\StatistikoEvent;
|
||||
use App\Models\Country;
|
||||
|
||||
class LoadEventsAverages
|
||||
{
|
||||
@@ -19,9 +17,9 @@ class LoadEventsAverages
|
||||
$start = $filter['start_date'] ?? 0;
|
||||
$end = $filter['end_date'] ?? 0;
|
||||
|
||||
if ($season_or_date != 'season')
|
||||
if ($season_or_date != 'season') {
|
||||
$season = 0;
|
||||
else {
|
||||
} else {
|
||||
$end = 0;
|
||||
$start = 0;
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Data\LoadEvents;
|
||||
namespace App\Filament\Widgets\Charts\LoadEvents;
|
||||
|
||||
use App\Filament\Pages\Selections\Helper\GetSeason;
|
||||
use App\Models\StatistikoEvent;
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Data\LoadEvents;
|
||||
namespace App\Filament\Widgets\Charts\LoadEvents;
|
||||
|
||||
use App\Filament\Pages\Selections\Helper\GetSeason;
|
||||
use App\Models\StatistikoEvent;
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Data\LoadEvents;
|
||||
namespace App\Filament\Widgets\Charts\LoadEvents;
|
||||
|
||||
use App\Models\StatistikoConfig;
|
||||
|
||||
+4
-5
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Data;
|
||||
namespace App\Filament\Widgets\Charts;
|
||||
|
||||
use Illuminate\Support\Carbon;
|
||||
use App\Models\StatisticFixtures;
|
||||
use App\Models\StatistikoEvent;
|
||||
use App\Models\StatistikoPlayer;
|
||||
use App\Models\StatisticFixtures;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class LoadPerformance
|
||||
{
|
||||
@@ -128,7 +128,6 @@ class LoadPerformance
|
||||
$home_av = self::makeAv($homes, $length);
|
||||
$away_av = self::makeAv($aways, $length);
|
||||
|
||||
|
||||
$res = StatistikoPlayer::whereIn('match_id', $league_matches)->select('match_id', 'ss_player_id', 'activeteam_id', 'minutes_played', 'playerrating_value', 'player_position')->get();
|
||||
$league = self::filterMatches($res, $league_matches);
|
||||
$league_av = self::leagueAv($league, $length);
|
||||
@@ -454,7 +453,7 @@ class LoadPerformance
|
||||
$result[$match_id]['def']['rating'] = 0;
|
||||
}
|
||||
|
||||
if (0 == $team_id || $value->activeteam_id == $team_id) {
|
||||
if ($team_id == 0 || $value->activeteam_id == $team_id) {
|
||||
|
||||
if ($value->minutes_played > 0) {
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Data;
|
||||
namespace App\Filament\Widgets\Charts;
|
||||
|
||||
use Illuminate\Support\Carbon;
|
||||
use App\Models\StatistikoDetail;
|
||||
use App\Models\StatistikoPlayer;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class LoadPlayerPerformance
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets\Data;
|
||||
namespace App\Filament\Widgets\Charts;
|
||||
|
||||
use App\Filament\Pages\Selections\Helper\GetSeason;
|
||||
use App\Models\StatistikoDetail;
|
||||
Reference in new issue
Block a user