@@ -46,7 +46,6 @@ class AircraftImporter extends BaseImporter
|
|||||||
}
|
}
|
||||||
|
|
||||||
$subfleet = $this->getSubfleet($subfleet_name, $row->icao, $airline_id);
|
$subfleet = $this->getSubfleet($subfleet_name, $row->icao, $airline_id);
|
||||||
$this->info('Subfleet ID is '.$subfleet->id);
|
|
||||||
|
|
||||||
$where = [
|
$where = [
|
||||||
'registration' => $row->registration,
|
'registration' => $row->registration,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace Modules\Importer\Services\Importers;
|
|||||||
use App\Models\Permission;
|
use App\Models\Permission;
|
||||||
use App\Models\Role;
|
use App\Models\Role;
|
||||||
use App\Services\RoleService;
|
use App\Services\RoleService;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
use Modules\Importer\Services\BaseImporter;
|
use Modules\Importer\Services\BaseImporter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -110,7 +111,25 @@ class GroupImporter extends BaseImporter
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the ID of the permission
|
// Get the ID of the permission
|
||||||
$permissions[] = $permMappings[$this->legacy_to_permission[$legacy_name]];
|
try {
|
||||||
|
$permName = $this->legacy_to_permission[$legacy_name];
|
||||||
|
if ($permName === 'admin') {
|
||||||
|
foreach ($permMappings as $name => $value) {
|
||||||
|
if (!in_array($value, $permissions)) {
|
||||||
|
$permissions[] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$permMapId = $permMappings[$permName];
|
||||||
|
if (!in_array($permMapId, $permissions)) {
|
||||||
|
$permissions[] = $permMapId;
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Log::error($e->getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ class ImporterDB
|
|||||||
|
|
||||||
$rows = [];
|
$rows = [];
|
||||||
$result = $this->readRowsOffset($table, $this->batchSize, $offset, $order_by, $fields);
|
$result = $this->readRowsOffset($table, $this->batchSize, $offset, $order_by, $fields);
|
||||||
if ($result === false) {
|
if ($result === false || $result === null) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,7 +203,7 @@ class ImporterDB
|
|||||||
foreach ($result as $row) {
|
foreach ($result as $row) {
|
||||||
$rows[] = $row;
|
$rows[] = $row;
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Log::error('foreach rows error: '.$e->getMessage());
|
Log::error('foreach rows error: '.$e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user