This commit is contained in:
salam committed 2026-09-14 21:24:27 +02:00
1 parent 443bff0a2b
commit 2a54730e60
1 file changed
+5 -4
@@ -12,12 +12,12 @@ class ImportDetails
{ {
use UpdateHelper; use UpdateHelper;
public static array $player_collection = [];
public static function run(string $filePath): void public static function run(string $filePath): void
{ {
$now = now()->format('Y-m-d H:i:s'); $now = now()->format('Y-m-d H:i:s');
$player_collection = [];
SimpleExcelReader::create(storage_path('app/public/'.$filePath)) SimpleExcelReader::create(storage_path('app/public/'.$filePath))
->getRows() ->getRows()
->chunk(1000) ->chunk(1000)
@@ -41,7 +41,7 @@ class ImportDetails
if ($row[1] != '') { if ($row[1] != '') {
$player_collection[] = (int) $row[0]; self::$player_collection[] = (int) $row[0];
StatistikoDetail::upsert( StatistikoDetail::upsert(
[ [
@@ -97,9 +97,10 @@ class ImportDetails
// ); // );
} }
} }
}); });
StatistikoDetail::whereNotIn('ss_player_id', $player_collection)->update(['is_active' => 0, 'ss_team_id' => 0]); StatistikoDetail::whereNotIn('ss_player_id', self::$player_collection)->update(['is_active' => 0, 'ss_team_id' => 0]);
/**update statistic player tabel */ /**update statistic player tabel */
// UpdateHelper::updatePlayers(1000000); // UpdateHelper::updatePlayers(1000000);