Ajustes de traduccion y creacion post merge
This commit is contained in:
parent
a372571fa7
commit
73752f90de
2 changed files with 9 additions and 13 deletions
|
@ -23,10 +23,10 @@ class BonoBarrialSeeder extends Seeder
|
||||||
'precio' => 20,
|
'precio' => 20,
|
||||||
'solidario' => false,
|
'solidario' => false,
|
||||||
'bono' => true,
|
'bono' => true,
|
||||||
'categoria_id' => Categoria::first([
|
'categoria_id' => Categoria::firstOrCreate([
|
||||||
'nombre' => 'TRANSPORTE, BONOS Y FINANCIAMIENTO SORORO'
|
'nombre' => 'TRANSPORTE, BONOS Y FINANCIAMIENTO SORORO'
|
||||||
])->id,
|
])->id,
|
||||||
'barrio_id' => Barrio::first([
|
'barrio_id' => Barrio::firstOrCreate([
|
||||||
'nombre'=>'PRUEBA'
|
'nombre'=>'PRUEBA'
|
||||||
])->id,
|
])->id,
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -41,12 +41,12 @@ class CanastaSeeder extends Seeder
|
||||||
$currentCategoria = Categoria::firstOrCreate(['nombre' => $tipo]);
|
$currentCategoria = Categoria::firstOrCreate(['nombre' => $tipo]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
[$solidario, $name, $caracteristicas] = $this->parseAndFormatName($record[$productoColumn]);
|
[$solidario, $nombre, $caracteristicas] = $this->parseAndFormatName($record[$productoColumn]);
|
||||||
|
|
||||||
$productosToInsert[] = [
|
$productosToInsert[] = [
|
||||||
'nombre' => $parsed['nombre'],
|
'nombre' => $nombre,
|
||||||
'precio' => $record[$precioColumn],
|
'precio' => $record[$precioColumn],
|
||||||
'solidario' => $parsed['solidario'],
|
'solidario' => $solidario,
|
||||||
'bono' => $tipo == 'B',
|
'bono' => $tipo == 'B',
|
||||||
'categoria_id' => $currentCategoria->id,
|
'categoria_id' => $currentCategoria->id,
|
||||||
'created_at' => Date::now(),
|
'created_at' => Date::now(),
|
||||||
|
@ -54,8 +54,8 @@ class CanastaSeeder extends Seeder
|
||||||
];
|
];
|
||||||
|
|
||||||
$caracteristicasToInsert[] = [
|
$caracteristicasToInsert[] = [
|
||||||
'nombre' => $parsed['nombre'],
|
'nombre' => $nombre,
|
||||||
'caracteristicas' => $parsed['caracteristicas']
|
'caracteristicas' => $caracteristicas
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,11 +89,7 @@ class CanastaSeeder extends Seeder
|
||||||
$nombre = Str::replaceMatches('/\(S\-.*\)/', '', $nombre);
|
$nombre = Str::replaceMatches('/\(S\-.*\)/', '', $nombre);
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [$solidario, trim($nombre), $caracteristicas];
|
||||||
'solidario' => $solidario,
|
|
||||||
'nombre' => trim($nombre),
|
|
||||||
'caracteristicas' => $caracteristicas
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function insertCaracteristicas($caracteristicasToInsert) : void {
|
private function insertCaracteristicas($caracteristicasToInsert) : void {
|
||||||
|
@ -102,7 +98,7 @@ class CanastaSeeder extends Seeder
|
||||||
$match = Producto::where('nombre',$nombre)->first();
|
$match = Producto::where('nombre',$nombre)->first();
|
||||||
if ($match) {
|
if ($match) {
|
||||||
foreach ($item['caracteristicas'] as $codigo => $caracteristica) {
|
foreach ($item['caracteristicas'] as $codigo => $caracteristica) {
|
||||||
DB::table('productos_caracteristicas')->insert([
|
DB::table('producto_caracteristica')->insert([
|
||||||
'producto_id' => $match->id,
|
'producto_id' => $match->id,
|
||||||
'caracteristica_id' => $caracteristica,
|
'caracteristica_id' => $caracteristica,
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue