This commit is contained in:
salam committed 2026-07-30 12:03:46 +02:00
1 parent 971d97a573
commit 62c3f80256
9 files changed
+15 -15

No files matched your search

@@ -35,10 +35,10 @@ class Rose
$res = SofaScoreRosa::get();
foreach ($res as $value) {
$url = Nuh::$options['base_url'] . 'api/v1/team/' . $value->ssteam_id . '/players';
$url = Nuh::$options['base_url'] . 'api/v1/team/' . $value->ss_team_id . '/players';
$data = CurlSofa::load($url);
$data['ss_team_id'] = $value->ssteam_id;
$data['ss_team_id'] = $value->ss_team_id;
$data['ss_team_name'] = $value->ssteam_name;
/*********************************
@@ -28,7 +28,7 @@ class SettingsToProduction
foreach ($rows as $row) {
DB::connection('remote_mariadb')->table('sofa_score_rosa_tournaments')->insert([
"ssteam_id" => $row->ssteam_id,
"ss_team_id" => $row->ss_team_id,
"ss_tournament_id" => $row->ss_tournament_id,
"disabled" => $row->disabled,
"grapped" => $row->grapped,
@@ -51,13 +51,13 @@ class TournamentTeams
foreach ($data['standings'][0]['rows'] as $row) {
$teams_counter++;
$ssteam_id = $row['team']['id'];
$ss_team_id = $row['team']['id'];
$name = $row['team']['name'];
$country_id = $tournament->sofascore_category->country_id;
SofaScoreRosa::updateOrCreate([
'sport_id' => $tournament->sport_id,
'ssteam_id' => (int) $ssteam_id,
'ss_team_id' => (int) $ss_team_id,
], [
'country_id' => (int) $country_id,
'ssteam_name' => $name,
@@ -66,7 +66,7 @@ class TournamentTeams
]);
SofaScoreRosaTournament::updateOrCreate([
'ss_tournament_id' => (int) $tournament->tournament_id,
'ssteam_id' => (int) $ssteam_id,
'ss_team_id' => (int) $ss_team_id,
], [
'grapped' => 1,
'disabled' => 0,
@@ -20,7 +20,7 @@ class SofaScoreRosasTable
return $table
->defaultPaginationPageOption(50)
->columns([
TextColumn::make('ssteam_id')->label('SSId')->badge()->width('1rem'),
TextColumn::make('ss_team_id')->label('SSId')->badge()->width('1rem'),
TextColumn::make('country.name')->label('Country'),
TextColumn::make('tournament_rosa.tournament.name')->label('Tournament'),
TextColumn::make('ssteam_name')->label('Name'),
@@ -62,9 +62,9 @@ class SofaScoreRosasTable
)->when(
$data['ss_tournament_id'],
function (Builder $query, $ss_tournament_id) {
$ssteam_ids = SofaScoreRosaTournament::where('ss_tournament_id', $ss_tournament_id)->pluck('ssteam_id')->toArray();
$ss_team_ids = SofaScoreRosaTournament::where('ss_tournament_id', $ss_tournament_id)->pluck('ss_team_id')->toArray();
$query->whereIn('ssteam_id', $ssteam_ids);
$query->whereIn('ss_team_id', $ss_team_ids);
}
);
}),
+2 -2
View File
@@ -8,7 +8,7 @@ class SofaScoreRosa extends Model
{
protected $fillable = [
'sport_id',
'ssteam_id',
'ss_team_id',
'ssteam_name',
'ss_tournament_id',
'country_id',
@@ -24,6 +24,6 @@ class SofaScoreRosa extends Model
public function tournament_rosa()
{
return $this->belongsTo(SofaScoreRosaTournament::class, 'ssteam_id', 'ssteam_id');
return $this->belongsTo(SofaScoreRosaTournament::class, 'ss_team_id', 'ss_team_id');
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model;
class SofaScoreRosaTournament extends Model
{
protected $fillable = [
'ssteam_id',
'ss_team_id',
'ss_tournament_id',
'grapped',
'disabled',
@@ -14,7 +14,7 @@ return new class extends Migration
Schema::create('sofa_score_rosas', function (Blueprint $table) {
$table->id();
$table->integer('sport_id')->index();
$table->integer('ssteam_id')->index();
$table->integer('ss_team_id')->index();
$table->integer('country_id')->default(0)->nullable()->index()->references('id')->on('countries');
$table->string('ssteam_name');
$table->boolean('is_active')->default(false);
@@ -13,7 +13,7 @@ return new class extends Migration
{
Schema::create('sofa_score_rosa_tournaments', function (Blueprint $table) {
$table->id();
$table->integer('ssteam_id')->index();
$table->integer('ss_team_id')->index();
$table->integer('ss_tournament_id')->default(0)->nullable()->index();
$table->boolean('disabled')->default(false);
$table->boolean('grapped')->default(false);
@@ -1,4 +1,4 @@
SSTEAM_ID;TEAM_NAME;country_id;
ss_team_id;TEAM_NAME;country_id;
36836;Aldosivi;467;
3216;Argentinos Juniors;467;
36833;Atletico Tucuman;467;
1 SSTEAM_ID ss_team_id TEAM_NAME country_id
2 36836 Aldosivi 467
3 3216 Argentinos Juniors 467
4 36833 Atletico Tucuman 467