update SofaScoreRosaTournament import
This commit is contained in:
1 parent
9cfa60de30
commit
b20fcb0034
2 files changed
+14
-12
No files matched your search
@@ -23,23 +23,24 @@ class ImportTeamsTournaments
|
||||
|
||||
$row = array_values($row);
|
||||
|
||||
self::$active_tournament[] = $row[0];
|
||||
$ss_tournament_id = (int) $row[0];
|
||||
|
||||
dd($row);
|
||||
SofaScoreRosaTournament::updateOrCreate(
|
||||
[
|
||||
'ss_tournament_id' => (int) $row[0],
|
||||
],
|
||||
[
|
||||
'ss_team_id' => (int) $row[1],
|
||||
'in_update' => 1,
|
||||
]
|
||||
);
|
||||
$ss_team_id = (int) $row[1];
|
||||
|
||||
if ($ss_tournament_id && $ss_team_id) {
|
||||
|
||||
self::$active_tournament[] = $row[0];
|
||||
|
||||
SofaScoreRosaTournament::updateOrCreate(
|
||||
['ss_tournament_id' => $ss_tournament_id, 'ss_team_id' => $ss_team_id],
|
||||
['in_update' => 1]
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$tournaments = array_unique(self::$active_tournament);
|
||||
|
||||
SofaScoreRosaTournament::where('in_update', 0)->whereIn('torunament_id', $tournaments)->delete();
|
||||
SofaScoreRosaTournament::where('in_update', 0)->whereIn('ss_tournament_id', $tournaments)->delete();
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ class SofaScoreRosaTournament extends Model
|
||||
'major',
|
||||
'grapped',
|
||||
'disabled',
|
||||
'in_update',
|
||||
];
|
||||
|
||||
public function tournament()
|
||||
|
||||
Reference in new issue
Block a user