✏️ 正在编辑: CallcenterStatusAtendimento.php
路径:
/srv/systems_dir/yuppiecred/application/models/CallcenterStatusAtendimento.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Model_CallcenterStatusAtendimento { private $_id; private $_descricao; private $_codigo; private $_desativarClienteCallcenter; private $_tipoTabulacao; private $_negocioFechado; private $_exibirOportunidades; private $_permiteOutroAtender; public function getId() { return $this->_id; } public function setId($id) { $this->_id = $id; } public function getDescricao() { return $this->_descricao; } public function setDescricao($descricao) { $this->_descricao = $descricao; } public function getCodigo() { return $this->_codigo; } public function setCodigo($codigo) { $this->_codigo = $codigo; } function getDesativarClienteCallcenter() { return $this->_desativarClienteCallcenter; } function setDesativarClienteCallcenter($desativarClienteCallcenter) { $this->_desativarClienteCallcenter = $desativarClienteCallcenter; } public function getTipoTabulacao() { return $this->_tipoTabulacao; } public function setTipoTabulacao($tipoTabulacao) { $this->_tipoTabulacao = $tipoTabulacao; } public function getNegocioFechado() { return $this->_negocioFechado; } public function setNegocioFechado($negocioFechado) { $this->_negocioFechado = $negocioFechado; } public function getExibirOportunidades() { return $this->_exibirOportunidades; } public function setExibirOportunidades($exibirOportunidades) { $this->_exibirOportunidades = $exibirOportunidades; } public function getPermiteOutroAtender() { return $this->_permiteOutroAtender; } public function setPermiteOutroAtender($permiteOutroAtender) { $this->_permiteOutroAtender = $permiteOutroAtender; } 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_CallcenterStatusAtendimento(); $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_CallcenterStatusAtendimento $statusCampanha */ public function salvar(Model_CallcenterStatusAtendimento $statusCampanha) { $dbtable = new Model_DbTable_CallcenterStatusAtendimento(); if( $statusCampanha->getId() > 0 ){ $dbtable->update($statusCampanha->_toArray(), "id = " . $statusCampanha->getId()); return $statusCampanha->getId(); } else { return $dbtable->insert($statusCampanha->_toArray()); } } /** * 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_CallcenterStatusAtendimento(); return $dbtable->delete(["id = ?" => $id]); } return null; } /** * Retorna uma lista * @param string $fields * @param string $order * @return Zend_Db_Table_Rowset_Abstract The row results per the Zend_Db_Adapter fetch mode. */ public function listar($fields = null, $order = "descricao ASC") { $where = []; if( !empty($fields['descricao']) ){ $where['descricao LIKE ?'] = "%{$fields['descricao']}%"; } if( !empty($fields['tipo_tabulacao']) ){ $where['tipo_tabulacao = ?'] = $fields['tipo_tabulacao']; } $dbtable = new Model_DbTable_CallcenterStatusAtendimento(); return $dbtable->fetchAll($where, $order); } /** * 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_CallcenterStatusAtendimento(); return $dbtable->fetchRow(["id = ?" => $id]); } public static function getTabulacaoNegativa() { return (new Model_DbTable_CallcenterStatusAtendimento()) ->fetchPairs('descricao', "tipo_tabulacao = 'Negativa'"); } public static function getStatusDesativaCliente() { return (new Model_DbTable_CallcenterStatusAtendimento()) ->fetchPairs('descricao', "desativar_cliente_callcenter = 1"); } public static function getStatusParaAgendamento() { $agendamento = [ "RETORNAR" => "RETORNAR", "AGENDAMENTO NA LOJA" => "AGENDAMENTO NA LOJA", "NEGOCIANDO" => "NEGOCIANDO", "CLIENTE VEM NA LOJA" => "CLIENTE VEM NA LOJA", "RECEPTIVO" => "RECEPTIVO" ]; return array_intersect($agendamento, (new Model_DbTable_CallcenterStatusAtendimento())->fetchPairs('descricao')); } public function permiteOutroOperadorAtender($statusAtendimento) { return (new Model_DbTable_CallcenterStatusAtendimento())->fetchRow(["descricao = '$statusAtendimento'", "permite_outro_atender = 1"]); } }
💾 保存文件
← 返回文件管理器