✏️ 正在编辑: RetencaoPortabilidade.php
路径:
/srv/systems_dir/yuppiecred-lidernegocios/application/models/RetencaoPortabilidade.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Model_RetencaoPortabilidade { private $_id; private $_numeroContrato; private $_numeroAde; private $_nomeCliente; private $_cpfCliente; private $_banco; private $_bancoId; private $_dataMaximaRetencao; private $_estimativaTroco1; private $_estimativaTroco2; private $_estimativaOferta; private $_matricula; private $_codigoConvenio; private $_convenio; private $_parcela; private $_qtdParcelas; private $_qtdParcelasRestantes; private $_taxaAtual; private $_taxaConcorrencia; private $_anexo; private $_aprovado; private $_numeroProposta; private $_digitador; /** * @return mixed */ public function getId() { return $this->_id; } /** * @param mixed $id */ public function setId($id): void { $this->_id = $id; } /** * @return mixed */ public function getNumeroContrato() { return $this->_numeroContrato; } /** * @param mixed $numeroContrato */ public function setNumeroContrato($numeroContrato): void { $this->_numeroContrato = $numeroContrato; } /** * @return mixed */ public function getNumeroAde() { return $this->_numeroAde; } /** * @param mixed $numeroAde */ public function setNumeroAde($numeroAde): void { $this->_numeroAde = $numeroAde; } /** * @return mixed */ public function getNomeCliente() { return $this->_nomeCliente; } /** * @param mixed $nomeCliente */ public function setNomeCliente($nomeCliente): void { $this->_nomeCliente = $nomeCliente; } /** * @return mixed */ public function getCpfCliente() { return $this->_cpfCliente; } /** * @param mixed $cpfCliente */ public function setCpfCliente($cpfCliente): void { $this->_cpfCliente = $cpfCliente; } /** * @return mixed */ public function getBanco() { return $this->_banco; } /** * @param mixed $banco */ public function setBanco($banco): void { $this->_banco = $banco; } /** * @return mixed */ public function getBancoId() { return $this->_bancoId; } /** * @param mixed $grupo */ public function setBancoId($bancoId): void { $this->_bancoId = $bancoId; } /** * @return mixed */ public function getDataMaximaRetencao() { return $this->_dataMaximaRetencao; } /** * @param mixed $dataMaximaRetencao */ public function setDataMaximaRetencao($dataMaximaRetencao): void { $this->_dataMaximaRetencao = $dataMaximaRetencao; } /** * @return mixed */ public function getEstimativaTroco1() { return $this->_estimativaTroco1; } /** * @param mixed $estimativaTroco1 */ public function setEstimativaTroco1($estimativaTroco1): void { $this->_estimativaTroco1 = $estimativaTroco1; } /** * @return mixed */ public function getEstimativaTroco2() { return $this->_estimativaTroco2; } /** * @param mixed $estimativaTroco2 */ public function setEstimativaTroco2($estimativaTroco2): void { $this->_estimativaTroco2 = $estimativaTroco2; } /** * @return mixed */ public function getEstimativaOferta() { return $this->_estimativaOferta; } /** * @param mixed $estimativaOferta */ public function setEstimativaOferta($estimativaOferta): void { $this->_estimativaOferta = $estimativaOferta; } /** * @return mixed */ public function getMatricula() { return $this->_matricula; } /** * @param mixed $matricula */ public function setMatricula($matricula): void { $this->_matricula = $matricula; } /** * @return mixed */ public function getCodigoConvenio() { return $this->_codigoConvenio; } /** * @param mixed $codigoConvenio */ public function setCodigoConvenio($codigoConvenio): void { $this->_codigoConvenio = $codigoConvenio; } /** * @return mixed */ public function getConvenio() { return $this->_convenio; } /** * @param mixed $convenio */ public function setConvenio($convenio): void { $this->_convenio = $convenio; } /** * @return mixed */ public function getParcela() { return $this->_parcela; } /** * @param mixed $parcela */ public function setParcela($parcela): void { $this->_parcela = $parcela; } /** * @return mixed */ public function getQtdParcelas() { return $this->_qtdParcelas; } /** * @param mixed $qtdParcelas */ public function setQtdParcelas($qtdParcelas): void { $this->_qtdParcelas = $qtdParcelas; } /** * @return mixed */ public function getQtdParcelasRestantes() { return $this->_qtdParcelasRestantes; } /** * @param mixed $qtdParcelasRestantes */ public function setQtdParcelasRestantes($qtdParcelasRestantes): void { $this->_qtdParcelasRestantes = $qtdParcelasRestantes; } /** * @return mixed */ public function getTaxaAtual() { return $this->_taxaAtual; } /** * @param mixed $taxaAtual */ public function setTaxaAtual($taxaAtual): void { $this->_taxaAtual = $taxaAtual; } /** * @return mixed */ public function getTaxaConcorrencia() { return $this->_taxaConcorrencia; } /** * @param mixed $taxaConcorrencia */ public function setTaxaConcorrencia($taxaConcorrencia): void { $this->_taxaConcorrencia = $taxaConcorrencia; } /** * @return mixed */ public function getDigitador() { return $this->_digitador; } /** * @param mixed $digitador */ public function setDigitador($digitador): void { $this->_digitador = $digitador; } public function __construct($options = null) { if( is_array($options) ){ $this->setOptions($options); } } public function setOptions(array $options) { $methods = get_class_methods($this); foreach ( $options as $key => $value ) { $explode = explode('_', $key); $methodName = ''; foreach ( $explode as $v ) { $methodName .= ucfirst($v); } $key = $methodName != '' ? $methodName : $key; $method = 'set' . ucfirst($key); if( in_array($method, $methods) ){ $this->$method($value); } } return $this; } public function _toArray() { $dbtable = new Model_DbTable_Banco(); $info = $dbtable->info(); $methods = get_class_methods($this); $data = array(); foreach ( $info['cols'] as $key ) { $col = $key; $explode = explode('_', $key); $methodName = ''; foreach ( $explode as $v ) { $methodName .= ucfirst($v); } $key = $methodName != '' ? $methodName : $key; $method = 'get' . ucfirst($key); if( in_array($method, $methods) ){ $data[$col] = $this->$method(); } } return $data; } public function importarContratosRetencao(array $values) { $result = null; if (count($values) > 0) { $model = new Core_RetencaoPortabilidade_Planilha(); $result = $model->importar($values); } return $result; } public function listar($fields = null, $order = null) { $params = array(); $where = null; $dbtable = new Model_DbTable_RetencaoPortabilidade(); $select = $dbtable->getAdapter()->select(); $select->from([ 'retencao' => "tb_retencao_portabilidade" ], ['retencao.*']) ->joinLeft([ 'corretores' => "tb_corretores" ], 'corretores.id = retencao.corretor_id', [ 'corretor' => 'nome', 'cpf', 'email' ]) ->joinLeft([ 'banco' => "tb_bancos" ], 'banco.id = retencao.banco_id', [ 'banco_nome' => 'nome' ]); $select->where('retencao.excluido <> 1'); if( isset($fields['numero_contrato']) && !empty($fields['numero_contrato']) ){ $select->where("numero_contrato LIKE ? ", "%{$fields['numero_contrato']}%"); } if( isset($fields['numero_ade']) && !empty($fields['numero_ade']) ){ $select->where("numero_ade LIKE ? ", "%{$fields['numero_ade']}%"); } if( !empty($fields['data_maxima_retencao_de']) ){ $date = new Zend_Date($fields['data_maxima_retencao_de']); $cadastro = $date->get('YYYY-MM-dd'); $select->where("retencao.data_maxima_retencao >= ? ", $cadastro); } if( !empty($fields['data_maxima_retencao_a']) ){ $date = new Zend_Date($fields['data_maxima_retencao_a']); $cadastro = $date->get('YYYY-MM-dd'); $select->where("retencao.data_maxima_retencao <= ? ", $cadastro); } if( isset($fields['cpf_cliente']) && !empty($fields['cpf_cliente']) ){ $select->where("cpf_cliente LIKE ?", "%". String_Refatorar::soNumeros($fields['cpf_cliente']) ."%"); } if( isset($fields['situacao']) && $fields['situacao'] != ''){ if(is_array($fields['situacao'])){ $select->where("retencao.situacao IN (?)", new Zend_Db_Expr(implode(",", $fields['situacao']))); } } if (isset($fields['digitador']) && !empty($fields['digitador'])) { $select->where("digitador LIKE ?", "'%" . $fields['digitador'] . "%'"); } if (isset($fields['corretores']) && !empty($fields['corretores'])) { if(is_array($fields['corretores'])){ $select->where("corretores.id IN (?) ", new Zend_Db_Expr(implode(",", $fields['corretores']))); } } return $dbtable->getAdapter()->fetchAll($select); } public function exibir($id) { $dbtable = new Model_DbTable_RetencaoPortabilidade(); if( $id > 0 ){ $id = (int) $id; return $dbtable->fetchRow(["id = ? " => $id]); } return null; } public function excluir($id) { if( $id > 0 ){ $dbtable = new Model_DbTable_RetencaoPortabilidade(); $result = $dbtable->delete(["id = ?" => $id]); return $result; } return null; } }
💾 保存文件
← 返回文件管理器