wip
This commit is contained in:
1 parent
486322d765
commit
085dc78e26
1 file changed
+3
-5
@@ -11,9 +11,7 @@ class ImportDetails
|
|||||||
{
|
{
|
||||||
public static function run(string $filePath): void
|
public static function run(string $filePath): void
|
||||||
{
|
{
|
||||||
StatistikoDetail::query()->update(['last_import' => 0]);
|
StatistikoDetail::query()->update(['last_import' => 'out']);
|
||||||
|
|
||||||
sleep(2);
|
|
||||||
|
|
||||||
SimpleExcelReader::create(storage_path('app/public/'.$filePath))
|
SimpleExcelReader::create(storage_path('app/public/'.$filePath))
|
||||||
->getRows()
|
->getRows()
|
||||||
@@ -23,7 +21,7 @@ class ImportDetails
|
|||||||
$collection = [];
|
$collection = [];
|
||||||
foreach ($chunk as $row) {
|
foreach ($chunk as $row) {
|
||||||
$row['is_active'] = 1;
|
$row['is_active'] = 1;
|
||||||
$row['last_import'] = 1;
|
$row['last_import'] = 'in';
|
||||||
$row['birthdate'] = isset($row['birthday']) ? Carbon::parse($row['birthday'])->format('Y-m-d') : '';
|
$row['birthdate'] = isset($row['birthday']) ? Carbon::parse($row['birthday'])->format('Y-m-d') : '';
|
||||||
unset($row['birthday']);
|
unset($row['birthday']);
|
||||||
$row['last_update'] = Carbon::parse($row['last_update'])->format('Y-m-d H:i:s');
|
$row['last_update'] = Carbon::parse($row['last_update'])->format('Y-m-d H:i:s');
|
||||||
@@ -50,6 +48,6 @@ class ImportDetails
|
|||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
StatistikoDetail::where('last_import', 0)->update(['is_active' => 0, 'ss_team_id' => 0]);
|
StatistikoDetail::where('last_import', 'out')->update(['is_active' => 0, 'ss_team_id' => 0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user