|
@@ -66,24 +66,21 @@ trait HasParteCoinvolta{
|
|
|
|
|
|
|
|
if ($parte->conducente_o_pedone == 2) {
|
|
if ($parte->conducente_o_pedone == 2) {
|
|
|
|
|
|
|
|
-
|
|
|
|
|
$proprietarioRelation = ReportDataVeicoli::where('progressive', $progressive)
|
|
$proprietarioRelation = ReportDataVeicoli::where('progressive', $progressive)
|
|
|
->where('report_id', $this->dataId)
|
|
->where('report_id', $this->dataId)
|
|
|
- ->first()
|
|
|
|
|
- ->proprietario();
|
|
|
|
|
-
|
|
|
|
|
- $proprietario = $proprietarioRelation->first();
|
|
|
|
|
-
|
|
|
|
|
- Log::info('Proprietario: '.$proprietario->id);
|
|
|
|
|
- Log::info('Anagrafica: '.$anagrafica);
|
|
|
|
|
-
|
|
|
|
|
- if($anagrafica == $proprietario->id){
|
|
|
|
|
- $conducente_uguale_proprietario = true;
|
|
|
|
|
|
|
+ ->first();
|
|
|
|
|
+
|
|
|
|
|
+ if ($proprietarioRelation) {
|
|
|
|
|
+ $proprietario = $proprietarioRelation->proprietario()->first();
|
|
|
|
|
+ if ($proprietario) {
|
|
|
|
|
+ $conducente_uguale_proprietario = ($anagrafica == $proprietario->id);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $conducente_uguale_proprietario = false;
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
$conducente_uguale_proprietario = false;
|
|
$conducente_uguale_proprietario = false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
ReportDataVeicoli::updateOrCreate(
|
|
ReportDataVeicoli::updateOrCreate(
|
|
|
[
|
|
[
|
|
|
'report_id' => $this->dataId,
|
|
'report_id' => $this->dataId,
|