Ajuste Products.class.php
This commit is contained in:
parent
5ff7ed36f8
commit
aa10628d94
1 changed files with 4 additions and 18 deletions
22
vendor/model/Products.class.php
vendored
22
vendor/model/Products.class.php
vendored
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue