✏️ 正在编辑: CallcenterFgts.php
路径:
/srv/systems_dir/yuppiecred/application/models/DbTable/CallcenterFgts.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Model_DbTable_CallcenterFgts extends Core_DbTable { protected $_primary = 'id'; protected $_name = 'tb_callcenter_fgts'; protected $_referenceMap = [ 'Cliente' => [ 'columns' => ['base_id'], 'refTableClass' => 'Model_DbTable_CallcenterBase', 'refColumns' => ['id'] ], ]; public function insert(array $data) { Yuppie_Log::write("Tentativa de inserção de informações na tb_callcenter_fgts => " . print_r($data, true), $this); //limpa informacão antiga $this->delete("base_id = {$data['base_id']} AND data_cadastro < '" . Zend_Date::now()->subDay(10)->get('yyyy-MM-dd HH:mm:ss') . "'"); return parent::insert($data); } public function fetchStatus() { $select = $this->getAdapter()->select()->from($this->_name, ['descricao_erro']) ->where("descricao_erro IS NOT NULL") ->group("descricao_erro"); return $this->getAdapter()->fetchAll($select); } public function findByCpf(string $cpf, string $origemConsulta) { if (empty($cpf)) { return; } $select = $this->getAdapter()->select()->from(['fgts' => $this->_name], ['fgts.*']) ->joinInner(["base" => "tb_callcenter_base"], "base.id = fgts.base_id", []) ->joinInner(["tel" => "tb_callcenter_telefones"], "base.id = tel.cliente_id AND tel.excluido = 0", ['fone']) ->where("cpf = ?", $cpf) ->where("origem_consulta = ?", $origemConsulta) ->order("data_cadastro DESC"); $result = $this->getAdapter()->fetchRow($select); if ($result) { $tempo = (new Zend_Date())->now()->subDay(1)->getTimestamp(); $data = (new Zend_Date($result->data_cadastro))->getTimestamp(); //verifica se já passou 24hs if ($tempo > $data) { return; } } return $result; } }
💾 保存文件
← 返回文件管理器