Edit SofaScore Tasks add filter

This commit is contained in:
salam committed 2026-07-22 07:10:03 +02:00
1 parent 210aed8c97
commit b25cf15a9e
10 files changed
+120 -39

No files matched your search

@@ -7,7 +7,7 @@ use App\Console\Commands\Grapper\Sofascore\Helper\LoadDays;
use App\Console\Commands\Grapper\Sofascore\Helper\Sleeper;
use App\Console\Commands\Nuh;
use App\Models\Country;
use App\Models\SofaScoreCategorie;
use App\Models\SofaScoreCategory;
use App\Models\SofaScoreDayTournament;
use App\Models\SofaScoreTournament;
use App\Utilities\Notice;
@@ -126,9 +126,9 @@ class DaysTournament
// CATEGORY find <-> replace
Log::channel('sofascore')->info($tournament);
$sofa_score_categorie_id = 10000000;
$sofa_score_category_id = 10000000;
} else {
$call = SofaScoreCategorie::updateOrCreate([
$call = SofaScoreCategory::updateOrCreate([
'id' => (int) $category['id'],
'country_id' => (int) $country_id,
'slug' => $category['slug'],
@@ -136,7 +136,7 @@ class DaysTournament
'name' => $category['name'],
]);
$sofa_score_categorie_id = $call->id;
$sofa_score_category_id = $call->id;
}
/**
@@ -145,7 +145,7 @@ class DaysTournament
SofaScoreTournament::updateOrCreate([
'sport_id' => (int) $sport_id,
'tournament_id' => (int) $tournament['id'],
'sofa_score_categorie_id' => (int) $sofa_score_categorie_id,
'sofa_score_category_id' => (int) $sofa_score_category_id,
], [
'name' => $tournament['name'],
'slug' => $tournament['slug'],
@@ -11,6 +11,7 @@ use App\Models\SofaScoreDayTournament;
use App\Models\SofaScoreEventGrapped;
use App\Models\SofaScoreTaskDay;
use App\Models\SofaScoreTaskTournament;
use App\Models\SofaScoreTournament;
use App\Utilities\Notice;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\File;
@@ -19,6 +20,7 @@ class Rose
{
public static function run()
{
$debug = Nuh::$options['d'] ?? 0;
$task_id = Nuh::$options['task'] ?? 0;
@@ -0,0 +1,24 @@
<?php
namespace App\Console\Commands\Grapper\Sofascore;
use App\Models\SofaScoreTaskTournament;
use App\Models\SofaScoreTournament;
use App\Utilities\Notice;
class SqlMover
{
public static function run()
{
$res = SofaScoreTaskTournament::get();
foreach ($res as $value) {
$res2 = SofaScoreTournament::where('tournament_id', $value->sofa_score_tournament_id)->first();
SofaScoreTaskTournament::where('id', $value->id)->update(['sofa_score_category_id' => $res2->sofa_score_category_id]);
}
Notice::note('done', 'bb', 1);
}
}