Atualizando companies_save.php
This commit is contained in:
parent
0b459d0a71
commit
25fac2abfb
1 changed files with 17 additions and 13 deletions
30
vendor/model/ProductsCompanies.class.php
vendored
30
vendor/model/ProductsCompanies.class.php
vendored
|
|
@ -120,19 +120,23 @@ class ProductsCompanies
|
|||
$this->companyId = $companyId;
|
||||
|
||||
/** Consulta SQL */
|
||||
$this->sql = 'select cp.product_company_id,
|
||||
cp.product_id,
|
||||
cp.company_id,
|
||||
cp.description,
|
||||
p.description as product,
|
||||
p.reference,
|
||||
cp.readjustment,
|
||||
cp.product_value,
|
||||
cp.maturity
|
||||
from products_companies cp
|
||||
left join products p on cp.product_id = p.product_id
|
||||
where cp.company_id = :company_id
|
||||
and cp.status = \'A\'';
|
||||
$this->sql = 'SELECT cp.maturity,
|
||||
cp.readjustment,
|
||||
GROUP_CONCAT(cp.product_company_id ORDER BY cp.product_company_id SEPARATOR ', ') AS product_company_ids,
|
||||
GROUP_CONCAT(cp.product_id ORDER BY cp.product_company_id SEPARATOR ', ') AS product_ids,
|
||||
GROUP_CONCAT(cp.description ORDER BY cp.product_company_id SEPARATOR ', ') AS descriptions,
|
||||
GROUP_CONCAT(p.description ORDER BY cp.product_company_id SEPARATOR ', ') AS products,
|
||||
GROUP_CONCAT(p.reference ORDER BY cp.product_company_id SEPARATOR ', ') AS references,
|
||||
GROUP_CONCAT(cp.product_value ORDER BY cp.product_company_id SEPARATOR ', ') AS product_values
|
||||
FROM
|
||||
products_companies cp
|
||||
LEFT JOIN
|
||||
products p ON cp.product_id = p.product_id
|
||||
WHERE
|
||||
cp.company_id = :company_id
|
||||
AND cp.status = 'A'
|
||||
GROUP BY
|
||||
cp.maturity, cp.readjustment;';
|
||||
|
||||
/** Preparo o SQL para execução */
|
||||
$this->stmt = $this->connection->connect()->prepare($this->sql);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue