From aa10628d949c75a551f17789c47cad754d3d20b2 Mon Sep 17 00:00:00 2001 From: Kenio de Souza Date: Thu, 17 Jul 2025 11:55:58 -0300 Subject: [PATCH] Ajuste Products.class.php --- vendor/model/Products.class.php | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/vendor/model/Products.class.php b/vendor/model/Products.class.php index 534f768..34a2997 100644 --- a/vendor/model/Products.class.php +++ b/vendor/model/Products.class.php @@ -114,15 +114,11 @@ class Products } /** Consulta SQL */ - $this->sql = 'select * from products - where company_id = :company_id ' . $this->limit; + $this->sql = 'select * from products ' . $this->limit; /** Preparo o SQL para execução */ $this->stmt = $this->connection->connect()->prepare($this->sql); - /** Preencho os parâmetros do SQL */ - $this->stmt->bindParam(':company_id', $_SESSION['USERSCOMPANYID']); - /** Executo o SQL */ $this->stmt->execute(); @@ -138,14 +134,11 @@ class Products $this->companyId = $companyId; /** Consulta SQL */ - $this->sql = 'select * from products where company_id = :companyId'; + $this->sql = 'select * from products'; /** Preparo o SQL para execução */ $this->stmt = $this->connection->connect()->prepare($this->sql); - /** Preenchimento de parâmetros */ - $this->stmt->bindParam(':companyId', $this->companyId); - /** Executo o SQL */ $this->stmt->execute(); @@ -159,14 +152,10 @@ class Products { /** Consulta SQL */ $this->sql = 'select count(products_id) as qtde - from products - where company_id = :company_id'; + from products'; /** Preparo o SQL para execução */ - $this->stmt = $this->connection->connect()->prepare($this->sql); - - /** Preencho os parâmetros do SQL */ - $this->stmt->bindParam(':company_id', $_SESSION['USERSCOMPANYID']); + $this->stmt = $this->connection->connect()->prepare($this->sql); /** Executo o SQL */ $this->stmt->execute(); @@ -218,14 +207,12 @@ class Products $this->sql = 'insert into products(products_type_id, description, users_id, - company_id, reference, version, version_release ) values (:products_type_id, :description, :users_id, - :company_id, :reference, :version, :version_release)'; @@ -235,7 +222,6 @@ class Products /** Preencho os parâmetros do SQL */ $this->stmt->bindParam('users_id', $_SESSION['USERSID']);/** Informa o usuário responsável pelo novo produto cadastrado */ - $this->stmt->bindParam('company_id', $_SESSION['USERSCOMPANYID']);/** Informa a qual empresa pertence o cliente */ $this->stmt->bindParam('products_type_id', $this->productsTypeId); $this->stmt->bindParam('description', $this->description); $this->stmt->bindParam('reference', $this->reference);