Atualizando Produtos company

This commit is contained in:
Kenio 2025-07-15 17:50:17 -03:00
parent 72ce0c8081
commit 65dd2e413f

View file

@ -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 */