✏️ 正在编辑: TermoResponsabilidade.php
路径:
/srv/systems_dir/yuppiecred/application/models/DbTable/TermoResponsabilidade.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Model_DbTable_TermoResponsabilidade extends Core_DbTable { protected $_primary = 'id'; protected $_name = 'tb_termo_responsabilidade'; /** * @return array */ public function getFirst(): array { $query = $this->getAdapter() ->select() ->from($this->_name) ->where('excluido <> ?', 1) ->limit(1) ; $termo = $this->getAdapter()->fetchRow($query); return !empty($termo) ? $termo : []; } public function getTermo(int $id): array { $query = $this->getAdapter() ->select() ->from($this->_name) ->where('id = ?', $id) ->where('excluido <> ?', 1) ; $termo = $this->getAdapter()->fetchRow($query); return !empty($termo) ? $termo : []; } public function listar($fields = null) { $select = $this->select()->setIntegrityCheck(false); $select->from(['termos' => $this->_name], ['*']) ->joinLeft(['empresa' => 'tb_empresas'], "termos.empresa_id = empresa.id AND empresa.excluido<>1", ['empresa' => 'empresa.nome']) ->where("termos.excluido<>1") ->order(['descricao']); if (!empty($fields['empresa_id'])) { $select->where("empresa_id = " . $fields['empresa_id']); } if (!empty($fields['descricao'])) { $select->where("descricao LIKE '%" . $fields['descricao'] . "%'"); } return $this->getAdapter()->fetchAll($select); } }
💾 保存文件
← 返回文件管理器