feat(webstatement): perbaiki logika filter atribut fillable di Sector
- Memperbarui logika untuk memfilter atribut array `fillable` pada model `Sector`: - Menambahkan filter untuk mengabaikan atribut `id` agar tidak terikut dalam proses. - Mengoptimalkan proses pengambilan header CSV dengan hanya menggunakan atribut yang relevan. Signed-off-by: Daeng Deni Mardaeni <ddeni05@gmail.com>
This commit is contained in:
@@ -108,7 +108,9 @@ class ProcessSectorDataJob implements ShouldQueue
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$headers = (new Sector())->getFillable();
|
$headers = array_filter((new Sector())->getFillable(), function($field) {
|
||||||
|
return $field !== 'id';
|
||||||
|
});
|
||||||
$rowCount = 0;
|
$rowCount = 0;
|
||||||
|
|
||||||
while (($row = fgetcsv($handle, 0, self::CSV_DELIMITER)) !== false) {
|
while (($row = fgetcsv($handle, 0, self::CSV_DELIMITER)) !== false) {
|
||||||
|
|||||||
Reference in New Issue
Block a user