✏️ 正在编辑: GrupoComissao.php
路径:
/srv/systems_dir/yuppiecred/application/models/DbTable/GrupoComissao.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Model_DbTable_GrupoComissao extends Core_DbTable { protected $_primary = 'id'; protected $_name = 'tb_grupos_comissao'; public function selectGrupoComissaoPorNome($nome) { $select = $this->getAdapter()->select() ->from($this->_name) ->where("descricao = ?", $nome) ->where('excluido = 0'); return $this->getAdapter()->fetchRow($select); } public function listarGrupos($fields = null) { $select = $this->getAdapter()->select() ->from($this->_name) ->joinLeft(['indicadores' => 'tb_corretores'], 'indicadores.id = tb_grupos_comissao.indicador_id', ['indicador_nome' => 'nome']) ->where('tb_grupos_comissao.excluido = 0'); if (!empty($fields['nome'])) { $select->where("descricao LIKE '%{$fields['nome']}%'"); } if (!empty($fields['indicador_id'])) { $select->where("tb_grupos_comissao.indicador_id = {$fields['indicador_id']}"); } if (Yuppie_Auth::getIdentity()->grupo == 'Indicador') { $select->where("tb_grupos_comissao.indicador_id = " . Yuppie_Auth::getIdentity()->id); } return $this->getAdapter()->fetchAll($select); } }
💾 保存文件
← 返回文件管理器