Fixed error where domains with exactly a soa record where not found

This commit is contained in:
Lukas Metzger 2018-05-10 20:32:28 +02:00
parent 8ffda92071
commit bf9f68a450

View file

@ -82,7 +82,7 @@ class Domains
$query = $this->db->prepare('
SELECT D.id,D.name,D.type,D.master,count(R.domain_id) AS records
FROM domains D
LEFT OUTER JOIN records R ON D.id = R.domain_id
LEFT OUTER JOIN records R ON D.id = R.domain_id AND R.type <> \'SOA\'
LEFT OUTER JOIN permissions P ON D.id = P.domain_id
WHERE (P.user_id=:userId OR :userIsAdmin) AND
(R.type <> \'SOA\' OR R.type IS NULL)
@ -223,7 +223,7 @@ class Domains
{
$query = $this->db->prepare('
SELECT D.id,D.name,D.type,D.master,COUNT(R.domain_id) AS records FROM domains D
LEFT OUTER JOIN records R ON D.id = R.domain_id
LEFT OUTER JOIN records R ON D.id = R.domain_id AND R.type <> \'SOA\'
WHERE D.id=:id AND (R.type <> \'SOA\' OR R.type IS NULL)
GROUP BY D.id,D.name,D.type,D.master
');