✏️ 正在编辑: CallcenterProposta.php
路径:
/srv/systems_dir/yuppiecred-lidernegocios/application/models/CallcenterProposta.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Model_CallcenterProposta { private $_id; private $_campanhaId; private $_clienteId; private $_corretorId; private $_tabelaId; private $_convenioId; private $_bancoId; private $_prazo; private $_produto; private $_numeroBeneficio; private $_valorBruto; private $_valorLiquido; private $_valorParcela; private $_bancoBeneficiado; private $_agenciaBeneficiado; private $_contaBeneficiado; private $_operacaoBeneficiado; private $_dataEmissao; private $_tipo; public function getId() { return $this->_id; } public function setId($id) { $this->_id = $id; } public function getCampanhaId() { return $this->_campanhaId; } public function setCampanhaId($campanhaId) { $this->_campanhaId = $campanhaId; } public function getClienteId() { return $this->_clienteId; } public function setClienteId($clienteId) { $this->_clienteId = $clienteId; } public function getCorretorId() { return $this->_corretorId; } public function setCorretorId($corretorId) { $this->_corretorId = $corretorId; } public function getTabelaId() { return $this->_tabelaId; } public function setTabelaId($tabelaId) { $this->_tabelaId = $tabelaId; } public function getConvenioId() { return $this->_convenioId; } public function setConvenioId($convenioId) { $this->_convenioId = $convenioId; } public function getBancoId() { return $this->_bancoId; } public function setBancoId($bancoId) { $this->_bancoId = $bancoId; } public function getPrazo() { return $this->_prazo; } public function setPrazo($prazo) { $this->_prazo = $prazo; } public function getProduto() { return $this->_produto; } public function setProduto($produto) { $this->_produto = $produto; } public function getNumeroBeneficio() { return $this->_numeroBeneficio; } public function setNumeroBeneficio($numeroBeneficio) { $this->_numeroBeneficio = $numeroBeneficio; } public function getValorBruto() { return $this->_valorBruto; } public function setValorBruto($valorBruto) { $this->_valorBruto = str_replace(array( '.', ',' ), array( '', '.' ), $valorBruto); } public function getValorLiquido() { return $this->_valorLiquido; } public function setValorLiquido($valorLiquido) { $this->_valorLiquido = str_replace(array( '.', ',' ), array( '', '.' ), $valorLiquido); } public function getValorParcela() { return $this->_valorParcela; } public function setValorParcela($valorParcela) { $this->_valorParcela = str_replace(array( '.', ',' ), array( '', '.' ), $valorParcela); } public function getBancoBeneficiado() { return $this->_bancoBeneficiado; } public function setBancoBeneficiado($bancoBeneficiado) { $this->_bancoBeneficiado = $bancoBeneficiado; } public function getAgenciaBeneficiado() { return $this->_agenciaBeneficiado; } public function setAgenciaBeneficiado($agenciaBeneficiado) { $this->_agenciaBeneficiado = $agenciaBeneficiado; } public function getContaBeneficiado() { return $this->_contaBeneficiado; } public function setContaBeneficiado($contaBeneficiado) { $this->_contaBeneficiado = $contaBeneficiado; } public function getOperacaoBeneficiado() { return $this->_operacaoBeneficiado; } public function setOperacaoBeneficiado($operacaoBeneficiado) { $this->_operacaoBeneficiado = $operacaoBeneficiado; } public function getDataEmissao() { return $this->_dataEmissao; } public function setDataEmissao($dataEmissao) { if( !empty($dataEmissao) ){ try{ $data = new Zend_Date($dataEmissao, Zend_Date::DATES, 'pt'); $dataEmissao = $data->toString('yyyy-MM-dd'); } catch (Zend_Date_Exception $e){ echo $e->getMessage(); $dataEmissao = null; } }else{ $dataEmissao = null; } $this->_dataEmissao = $dataEmissao; } public function getTipo() { return $this->_tipo; } public function setTipo($tipo) { $this->_tipo = $tipo; return $this; } 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_CallcenterProposta(); $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; } /** * Insere ou altera o registro passado por parâmetro * @param Model_CallcenterProposta $proposta */ public function salvar(Model_CallcenterProposta $proposta) { $dbtable = new Model_DbTable_CallcenterProposta(); if( $proposta->getId() > 0 ){ $dbtable->update($proposta->_toArray(), "id = " . $proposta->getId()); return $proposta->getId(); } else { return $dbtable->insert($proposta->_toArray()); } } /** * Retorna uma lista * @param string $where * @param string $order * @param int $count * @param int $offset * @return array */ public function listar($where = null, $order = null, $count = null, $offset = null) { $dbtable = new Model_DbTable_CallcenterProposta(); return $dbtable->fetchAll($where, $order, $count, $offset); } /** * Exclui o registro passado por parâmetro * @param int $id * @return int The number of rows deleted */ public function excluir($id) { if( $id > 0 ){ $dbtable = new Model_DbTable_CallcenterProposta(); return $dbtable->delete("id = " . $id); } return null; } /** * Retorna um fetchRow do item passado por parâmetro * @param int $id * @return Zend_Db_Table_Row_Abstract | null */ public function exibir($id) { $dbtable = new Model_DbTable_CallcenterProposta(); return $dbtable->fetchRow("id = " . $id); } public function getProposta($clienteId, $campanhaId) { if( $clienteId > 0 && $campanhaId > 0 ){ $dbtable = new Model_DbTable_CallcenterProposta(); $dados = $dbtable->fetchRow('campanha_id = ' . $campanhaId . " AND cliente_id = " . $clienteId); if( $dados != null ) return $dados->toArray(); } return array(); } }
💾 保存文件
← 返回文件管理器