return getDefunts empty when the user connected is not in thanato list yet
This commit is contained in:
parent
fecb319d6b
commit
66af13b124
@ -486,19 +486,18 @@ class Bdd {
|
||||
$conditions = [];
|
||||
if($isUserThanatoOnly){
|
||||
$thanato = $this->getThanatoByIdNextcloud($idNextcloud);
|
||||
if($thanato != null){
|
||||
if($thanato == null){
|
||||
return json_encode([]);
|
||||
}
|
||||
$thanatoId = $thanato["id"];
|
||||
$defuntsIdRelatedToThanato = $this->getDefuntIdsRelatedToThanato($thanatoId);
|
||||
if(!empty($defuntsIdRelatedToThanato)){
|
||||
if(empty($defuntsIdRelatedToThanato)){
|
||||
return json_encode([]);
|
||||
}
|
||||
$defuntListConditionPlaceholder = implode(',', array_fill(0, count($defuntsIdRelatedToThanato), '?'));
|
||||
$conditions = $defuntsIdRelatedToThanato;
|
||||
$sql .= " WHERE ".$this->tableprefix."defunt.id IN ($defuntListConditionPlaceholder)";
|
||||
}
|
||||
else{
|
||||
return json_encode([]);
|
||||
}
|
||||
}
|
||||
}
|
||||
$sql .= " ORDER BY ".$this->tableprefix."defunt.id DESC;";
|
||||
|
||||
$defuntsList = $this->execSQLNoJsonReturn($sql,$conditions);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user