|
|
@@ -19,7 +19,8 @@ class AssociadoImportService
|
|
|
Excel::import($import, $filePath);
|
|
|
$rows = $import->rows ?? collect();
|
|
|
|
|
|
- $today = Carbon::today()->toDateString();
|
|
|
+ $today = Carbon::today()->toDateString();
|
|
|
+ $expiryDate = Carbon::now()->endOfMonth()->toDateString();
|
|
|
|
|
|
$existing = User::where('type', UserTypeEnum::ASSOCIADO)
|
|
|
->whereNotNull('registration')
|
|
|
@@ -57,6 +58,9 @@ class AssociadoImportService
|
|
|
$changed = true;
|
|
|
}
|
|
|
|
|
|
+ $user->expiry_date = $expiryDate;
|
|
|
+ $changed = true;
|
|
|
+
|
|
|
if ($changed) {
|
|
|
$user->save();
|
|
|
$updated++;
|
|
|
@@ -74,6 +78,7 @@ class AssociadoImportService
|
|
|
'status' => UserStatusEnum::ACTIVE,
|
|
|
'registration' => $registration,
|
|
|
'admission_date' => $today,
|
|
|
+ 'expiry_date' => $expiryDate,
|
|
|
]);
|
|
|
|
|
|
$created++;
|