|
|
@@ -3,6 +3,7 @@
|
|
|
namespace App\Http\Livewire\Traits;
|
|
|
|
|
|
use App\Models\ReportDataPartiCoinvolte;
|
|
|
+use App\Models\ReportDataPedoni;
|
|
|
use App\Models\ReportDataVeicoli;
|
|
|
use App\Models\Vehicle;
|
|
|
|
|
|
@@ -72,6 +73,16 @@ trait HasParteCoinvolta{
|
|
|
'conducenti' => $anagrafica
|
|
|
]
|
|
|
);
|
|
|
+ }else{
|
|
|
+ ReportDataPedoni::updateOrCreate(
|
|
|
+ [
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
+ 'progressive' => $progressive,
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'pedoni' => $anagrafica
|
|
|
+ ]
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -120,7 +131,6 @@ trait HasParteCoinvolta{
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
$this->parti_coinvolte = ReportDataPartiCoinvolte::where('report_id', $this->dataId)->get();
|
|
|
}
|
|
|
|
|
|
@@ -178,6 +188,11 @@ trait HasParteCoinvolta{
|
|
|
'report_id' => $this->dataId,
|
|
|
'progressive' => $progressive
|
|
|
]);
|
|
|
+ }else{
|
|
|
+ ReportDataPedoni::create([
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
+ 'progressive' => $progressive
|
|
|
+ ]);
|
|
|
}
|
|
|
|
|
|
$this->parti_coinvolte = ReportDataPartiCoinvolte::where('report_id', $this->dataId)->get();
|