This commit is contained in:
MatteoPistorello 2024-07-15 17:32:10 +02:00
commit dbc274a1b7
1 changed files with 4 additions and 1 deletions

View File

@ -71,7 +71,10 @@ class Impianti extends AppResource
$interventi = $risorsa_interventi->getModifiedRecords(null); $interventi = $risorsa_interventi->getModifiedRecords(null);
$id_interventi = array_keys($interventi); $id_interventi = array_keys($interventi);
$statement->where('idtecnico', $id_tecnico)->orWhere('id', 'IN', 'SELECT idimpianto FROM my_impianti_interventi WHERE idintervento IN ('.implode(',', $id_interventi).')'); $rs_impianti = database()->fetchArray('SELECT idimpianto FROM my_impianti_interventi WHERE idintervento IN ('.implode(',', $id_interventi).')');
$id_impianti = array_column($rs_impianti, 'idimpianto');
$statement->where('idtecnico', $id_tecnico)->orWhereIn('id', $id_impianti);
} }
$records = $statement->get(); $records = $statement->get();