diff --git a/vendor/model/Users.class.php b/vendor/model/Users.class.php index bc4b9a3..6039460 100644 --- a/vendor/model/Users.class.php +++ b/vendor/model/Users.class.php @@ -136,14 +136,14 @@ class Users $this->sql = 'select count(u.user_id) as qtde from users u where u.email = :email - and u.clients_id <> :clients_id + and u.company_id <> :company_id and u.user_id <> :user_id'; /** Preparo o SQL para execução */ $this->stmt = $this->connection->connect()->prepare($this->sql); /** Preencho os parâmetros do SQL */ - $this->stmt->bindParam(':clients_id', $this->clientsId); + $this->stmt->bindParam(':company_id', $this->clientsId); $this->stmt->bindParam(':email', $this->email); $this->stmt->bindParam(':user_id', $this->usersId); @@ -172,7 +172,7 @@ class Users /** Verifica se o cliente foi informado */ if($this->clientsId > 0){ - $this->and .= " and clients_id = {$this->clientsId} "; + $this->and .= " and company_id = {$this->clientsId} "; } /** Consulta SQL */ @@ -202,11 +202,11 @@ class Users /** Verifica se o cliente foi informado */ if($this->clientsId > 0){ - $this->and .= " and clients_id = {$this->clientsId} "; + $this->and .= " and company_id = {$this->clientsId} "; }else{ - $this->and .= " and cast(clients_id as unsigned) = 0 "; + $this->and .= " and cast(company_id as unsigned) = 0 "; } /** Verifico se há paginação */ @@ -420,7 +420,7 @@ class Users if($this->usersId > 0){ /** Consulta SQL */ - $this->sql = 'update users set clients_id = :clients_id, + $this->sql = 'update users set company_id = :company_id, name_first = :name_first, name_last = :name_last, email = :email, @@ -446,7 +446,7 @@ class Users /** Preencho os parâmetros do SQL */ $this->stmt->bindParam('user_id', $this->usersId); - $this->stmt->bindParam('clients_id', $this->clientsId); + $this->stmt->bindParam('company_id', $this->clientsId); $this->stmt->bindParam('name_first', $this->nameFirst); $this->stmt->bindParam('name_last', $this->nameLast); $this->stmt->bindParam('email', $this->email); @@ -467,7 +467,7 @@ class Users }else{//Se o ID não foi informado, grava-se um novo registro /** Consulta SQL */ - $this->sql = 'insert into users(clients_id, + $this->sql = 'insert into users(company_id, user_id, company_id, name_first, @@ -481,7 +481,7 @@ class Users password_temp, user_id_create, password_temp_confirm - ) values (:clients_id, + ) values (:company_id, :user_id, :company_id, :name_first, @@ -501,7 +501,7 @@ class Users /** Preencho os parâmetros do SQL */ $this->stmt->bindParam('user_id', $this->usersId); - $this->stmt->bindParam('clients_id', $this->clientsId); + $this->stmt->bindParam('company_id', $this->clientsId); $this->stmt->bindParam('company_id', $this->companyId); $this->stmt->bindParam('name_first', $this->nameFirst); $this->stmt->bindParam('name_last', $this->nameLast);