This commit is contained in:
salam committed 2026-07-27 11:01:55 +02:00
1 parent 087b0a2a1a
commit 90b1dfdc4f
6 files changed
+25 -8

No files matched your search

@@ -7,7 +7,7 @@ use App\Models\StatisticFixtures;
class LoadStatisticFixturesLeaguesOptions
{
public static function load($sport_id)
public static function load(int $sport_id)
{
$res = StatisticFixtures::where('sport_id', $sport_id)
->groupBy('league_id')
@@ -6,7 +6,7 @@ use App\Models\StatisticFixtures;
class LoadStatisticFixturesMatchOptions
{
public static function load($league_id)
public static function load(int $league_id)
{
if (! $league_id) {
return [];
@@ -15,7 +15,7 @@ class LoadStatisticFixturesMatchOptions
$arr = [];
foreach ($res as $val) {
$arr[$val->id] = $val->starttime->format('Y-m-H H:i') . ' - ' . $val->home->name . ' vs ' . $val->away->name;
$arr[$val->id] = $val->starttime->format('Y-m-d H:i') . ' - ' . $val->home->name . ' vs ' . $val->away->name;
}
return $arr;
@@ -33,7 +33,9 @@ class Rose
}
}
$res = SofaScoreRosa::where('id', '>', 441)->get();
// $res = SofaScoreRosa::where('id', '>', 441)->get();
$res = SofaScoreRosa::get();
foreach ($res as $value) {
+8 -2
View File
@@ -25,7 +25,13 @@ class ImportEvents
* must be != null
* exp_home, exp_away, exp_handicap, exp_total
*/
if ((float) $row[21] != 0 && (float) $row[22] != 0 && (float) $row[23] != 0) {
if (
(float) $row[21] != 0
&& (float) $row[22] != 0
&& (float) $row[23] != 0
&& (float) $row[24] != 0
&& (string) $row[25] != ''
) {
StatistikoEvent::updateOrCreate(
[
@@ -56,7 +62,7 @@ class ImportEvents
'exp_away' => (float) $row[22],
'exp_handicap' => (float) $row[23],
'exp_total' => (float) $row[24],
'result_code' => $row[25], // w, d, l
'result_code' => (string) $row[25], // w, d, l
'created_at' => $now,
'updated_at' => $now,
]
+8
View File
@@ -8,6 +8,7 @@ use App\Models\StatistikoDetail;
use App\Models\StatistikoEvent;
use App\Models\StatistikoPlayer;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Log;
class LoadEvents
{
@@ -187,6 +188,9 @@ class LoadEvents
return [];
}
// Log::debug($res->toArray());
$dataset_home = [];
$dataset_away = [];
$dataset_exp_home = [];
@@ -201,6 +205,10 @@ class LoadEvents
// dd($value);
// $result_code = (string) $value['result_code'];
// Log::debug($result_code);
$labels[] = round($value['starttime']->diffInDays(Carbon::now()));
$playing_date[] = $value['starttime']->format('d. F Y H:i');
+3 -2
View File
@@ -9,7 +9,7 @@ use App\Utilities\Round;
use Filament\Widgets\Concerns\InteractsWithPageFilters;
use Filament\Widgets\StatsOverviewWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;
// use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\HtmlString;
use Livewire\Attributes\Reactive;
@@ -80,6 +80,7 @@ class StatsMedianAverage extends StatsOverviewWidget
}
if (isset($data['results'])) {
// Log::debug($data['results']);
$win = $data['results']['w'] ? number_format(Round::odd($total_home / $data['results']['w']), 2) : 0;
$draw = $data['results']['d'] ? number_format(Round::odd($total_home / $data['results']['d']), 2) : 0;
$lost = $data['results']['l'] ? number_format(Round::odd($total_home / $data['results']['l']), 2) : 0;
@@ -154,7 +155,7 @@ class StatsMedianAverage extends StatsOverviewWidget
return $boxes;
}
protected function templateOdds(&$data, float $win, float $draw, float $lost): HtmlString
protected function templateOdds(array &$data, float $win, float $draw, float $lost): HtmlString
{
if ($data['similar_past_matches'] != 'none') {
$name_win = '1 (' . $data['results']['w'] . ')';