Fix upload csv

This commit is contained in:
Pek5892 2024-03-27 10:17:27 +01:00
parent dfedb4b512
commit a864b251b2
2 changed files with 11 additions and 1 deletions

View File

@ -73,7 +73,8 @@ switch (filter('op')) {
$limit = 500;
// Inizializzazione del lettore CSV
$csv = new $import_manager($record->filepath);
$filepath = base_dir().'/files/'.$record->directory.'/'.$record->filename;
$csv = new $import_manager($filepath);
foreach ($fields as $key => $value) {
$csv->setColumnAssociation($key, (int) $value - 1);
}

View File

@ -31,6 +31,10 @@ class Import extends Model
protected $table = 'zz_imports';
protected static $translated_fields = [
'name',
];
// Relazioni Eloquent
public function moduloCollegato()
{
@ -41,4 +45,9 @@ class Import extends Model
{
return 'Import';
}
public static function getTranslatedFields()
{
return self::$translated_fields;
}
}