D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
rosario
/
adm
/
app
/
gre
/
Models
/
Cotacao
/
Filename :
ModCtProdutoNaoCotadoListar.php
back
Copy
<?php namespace App\gre\Models\Cotacao; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of ModCtProdutoListar * * @copyright (c) year, Carlos Marques - CM */ class ModCtProdutoNaoCotadoListar { private $Dados; private $Resultado; private $CotacaoId; private $SugestaoId; private $PageId; private $DadosExcel; public function listarProduto($PageId = null, $Dados = null) { $this->Dados = filter_input_array(INPUT_POST, FILTER_DEFAULT); //$this->Dados = $Dados; // var_dump($this->Dados); $this->DadosExcel = filter_input_array(INPUT_GET, FILTER_DEFAULT); // var_dump($this->DadosExcel); if(isset($this->DadosExcel['opcao'])){ $this->Dados['dataini'] = $this->DadosExcel['dataini']; $this->Dados['datafim'] = $this->DadosExcel['datafim']; }else{ $this->Dados = $Dados; } if(isset($this->Dados['dataini'])){ $this->pesquisarProduto(); return $this->Resultado; } } private function pesquisarProduto() { //var_dump($this->Dados); $listProduto = new \App\adms\Models\helper\AdmsRead(); $listProduto->fullRead("select :datai datai, :dataf dataf, date_format(:datai, '%d/%m/%Y') dataim, date_format(:dataf, '%d/%m/%Y') datafm, c.prod_cod, max(pr.nome) nome_prod, max(m.nome) nome_marca, case when max(cg.curva) is null then 'E' else max(cg.curva) end curva, count(*) ocorr from ct_cotacao c inner join ro_produto pr on c.prod_cod = pr.id inner join ro_marca m on pr.marca_id = m.id left join ro_curvag cg on cg.produto_id = c.prod_cod where c.data between :datai and :dataf and preco_cotado = 0 and pr.situacao_id = 1 and pr.status_compras_id = 1 and status_id in (2,3) and c.prod_cod not in (select p.prod_cod from ct_pedido_simulado p where p.data_cotacao between :datai and :dataf) group by c.prod_cod order by nome_marca", "datai=" . $this->Dados['dataini']. "&dataf=" . $this->Dados['datafim']); $this->Resultado = $listProduto->getResultado(); // var_dump($this->Resultado); return $this->Resultado; } }