From 43ee281888100d07cc213082a209b3fac93bb011 Mon Sep 17 00:00:00 2001 From: Kenio de Souza Date: Thu, 17 Jul 2025 10:00:04 -0300 Subject: [PATCH] Ajustando Users_datagrid --- vendor/model/Users.class.php | 11 ++--------- vendor/view/users/users_datagrid.php | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/vendor/model/Users.class.php b/vendor/model/Users.class.php index 6039460..c647ece 100644 --- a/vendor/model/Users.class.php +++ b/vendor/model/Users.class.php @@ -156,24 +156,17 @@ class Users } /** Contabiliza a quantidade de usuers cadastrados */ - public function Count(int $companyId, ? int $clientsId) + public function Count(int $companyId) { /** Parametros de entrada */ $this->companyId = $companyId; - $this->clientsId = $clientsId; /** Verifica se a empresa foi informada */ if($this->companyId > 0){ $this->and .= " and company_id = {$this->companyId} "; - } - - /** Verifica se o cliente foi informado */ - if($this->clientsId > 0){ - - $this->and .= " and company_id = {$this->clientsId} "; - } + } /** Consulta SQL */ $this->sql = 'select count(user_id) as qtde diff --git a/vendor/view/users/users_datagrid.php b/vendor/view/users/users_datagrid.php index 3f49d1b..c2de70e 100644 --- a/vendor/view/users/users_datagrid.php +++ b/vendor/view/users/users_datagrid.php @@ -29,7 +29,7 @@ if($Main->verifyToken()){ $CompaniesValidate->setCompanyId($companiesId); /** Consulta a quantidade de registros */ - $NumberRecords = $Users->Count($CompanyValidate->getCompanyId(), $CompaniesValidate->getCompanyId())->qtde; + $NumberRecords = $Users->Count($CompanyValidate->getCompanyId())->qtde; /** Verifico a quantidade de registros localizados */ if ($NumberRecords > 0){?>