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