Merge branch 'fixes/fix-get-defunts-when-thanato-only' into staging

This commit is contained in:
Tiavina 2025-01-09 16:40:31 +03:00
commit 063669ede9

View File

@ -486,19 +486,18 @@ class Bdd {
$conditions = []; $conditions = [];
if($isUserThanatoOnly){ if($isUserThanatoOnly){
$thanato = $this->getThanatoByIdNextcloud($idNextcloud); $thanato = $this->getThanatoByIdNextcloud($idNextcloud);
if($thanato != null){ if($thanato == null){
return json_encode([]);
}
$thanatoId = $thanato["id"]; $thanatoId = $thanato["id"];
$defuntsIdRelatedToThanato = $this->getDefuntIdsRelatedToThanato($thanatoId); $defuntsIdRelatedToThanato = $this->getDefuntIdsRelatedToThanato($thanatoId);
if(!empty($defuntsIdRelatedToThanato)){ if(empty($defuntsIdRelatedToThanato)){
return json_encode([]);
}
$defuntListConditionPlaceholder = implode(',', array_fill(0, count($defuntsIdRelatedToThanato), '?')); $defuntListConditionPlaceholder = implode(',', array_fill(0, count($defuntsIdRelatedToThanato), '?'));
$conditions = $defuntsIdRelatedToThanato; $conditions = $defuntsIdRelatedToThanato;
$sql .= " WHERE ".$this->tableprefix."defunt.id IN ($defuntListConditionPlaceholder)"; $sql .= " WHERE ".$this->tableprefix."defunt.id IN ($defuntListConditionPlaceholder)";
} }
else{
return json_encode([]);
}
}
}
$sql .= " ORDER BY ".$this->tableprefix."defunt.id DESC;"; $sql .= " ORDER BY ".$this->tableprefix."defunt.id DESC;";
$defuntsList = $this->execSQLNoJsonReturn($sql,$conditions); $defuntsList = $this->execSQLNoJsonReturn($sql,$conditions);