diff --git a/vendor/model/Documents.class.php b/vendor/model/Documents.class.php index 2bfbce3..30c2acc 100644 --- a/vendor/model/Documents.class.php +++ b/vendor/model/Documents.class.php @@ -133,11 +133,11 @@ class Documents /** Se houver um cliente informado, crio o filtro de consulta */ if($this->companyId === true){ - $this->and = " and company_id is not null"; + $this->and = " and d.company_id is not null"; } elseif ($this->companyId === false) { - $this->and = " and company_id is null"; + $this->and = " and d.company_id is null"; } /** Consulta SQL */ @@ -203,7 +203,7 @@ class Documents } /** Consulta SQL */ - echo $this->sql = 'select count(documents_id) as qtde + $this->sql = 'select count(documents_id) as qtde from documents where documents_id is not null '.$this->and;