From 65dd2e413f714129fb4403e7b760c1f287966cff Mon Sep 17 00:00:00 2001 From: Kenio de Souza Date: Tue, 15 Jul 2025 17:50:17 -0300 Subject: [PATCH] Atualizando Produtos company --- vendor/model/ProductsCompanies.class.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/vendor/model/ProductsCompanies.class.php b/vendor/model/ProductsCompanies.class.php index 3a67f9d..9d469ce 100644 --- a/vendor/model/ProductsCompanies.class.php +++ b/vendor/model/ProductsCompanies.class.php @@ -95,13 +95,13 @@ class ProductsCompanies /** Consulta SQL */ $this->sql = 'select * from products_companies - where client_product_id = :client_product_id'; + where product_company_id = :product_company_id'; /** Preparo o SQL para execução */ $this->stmt = $this->connection->connect()->prepare($this->sql); /** Preencho os parâmetros do SQL */ - $this->stmt->bindParam(':client_product_id', $this->clientProductId); + $this->stmt->bindParam(':product_company_id', $this->clientProductId); /** Executo o SQL */ $this->stmt->execute(); @@ -118,7 +118,7 @@ class ProductsCompanies $this->clientsId = $clientsId; /** Consulta SQL */ - $this->sql = 'select cp.client_product_id, + $this->sql = 'select cp.product_company_id, cp.products_id, cp.company_id, cp.description, @@ -228,7 +228,7 @@ class ProductsCompanies $this->clientsId = $clientsId; /** Consulta SQL */ - $this->sql = 'select count(client_product_id) as qtde + $this->sql = 'select count(product_company_id) as qtde from products_companies where company_id = :company_id '; /** Preparo o SQL para execução */ @@ -275,12 +275,12 @@ class ProductsCompanies readjustment = :readjustment, product_value = :product_value, maturity = :maturity - where client_product_id = :client_product_id'; + where product_company_id = :product_company_id'; }else{//Se o ID não foi informado, grava-se um novo registro /** Consulta SQL */ - $this->sql = 'insert into products_companies(client_product_id, + $this->sql = 'insert into products_companies(product_company_id, company_id, products_id, user_id_create, @@ -289,7 +289,7 @@ class ProductsCompanies readjustment, product_value, maturity - ) values (:client_product_id, + ) values (:product_company_id, :company_id, :products_id, :user_id_create, @@ -305,7 +305,7 @@ class ProductsCompanies $this->stmt = $this->connection->connect()->prepare($this->sql); /** Preencho os parâmetros do SQL */ - $this->stmt->bindParam('client_product_id', $this->clientProductId); + $this->stmt->bindParam('product_company_id', $this->clientProductId); $this->stmt->bindParam('products_id', $this->productsId); $this->stmt->bindParam('date_contract', $this->dateContract); $this->stmt->bindParam('description', $this->description); @@ -339,13 +339,13 @@ class ProductsCompanies $this->sql = 'update products_companies set status = \'E\', date_delete = CURRENT_TIMESTAMP, user_id_delete = :user_id_delete - where client_product_id = :client_product_id'; + where product_company_id = :product_company_id'; /** Preparo o sql para receber os valores */ $this->stmt = $this->connection->connect()->prepare($this->sql); /** Preencho os parâmetros do SQL */ - $this->stmt->bindParam('client_product_id', $this->clientProductId); + $this->stmt->bindParam('product_company_id', $this->clientProductId); $this->stmt->bindParam('user_id_delete', $this->usersIdDelete); /** Executo o SQL */