✏️ 正在编辑: FolhaPonto.php
路径:
/srv/systems_dir/yuppiecred-bkp/application/models/DbTable/FolhaPonto.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Model_DbTable_FolhaPonto extends Core_DbTable { protected $_primary = 'id'; protected $_name = 'tb_folha_ponto'; protected $_referenceMap = array( 'Funcionario' => array( 'columns' => array( 'funcionario_id' ), 'refTableClass' => 'Model_DbTable_Usuario', 'refColumns' => array( 'id' ) ), ); public function selectPresencasAgentesCallcenter() { $dataInicial = Zend_Date::now()->get('yyyy-MM'); $dataAtual = Zend_Date::now()->get('yyyy-MM-dd'); $select = $this->getAdapter() ->select() ->from( ['f' => 'tb_fornecedores'], ['agente_id' => 'f.id', 'agente' => 'u.nome'] ) ->joinInner( ['u' => 'tb_usuarios'], 'u.funcionario_id = f.id', ['grupo_id', 'dias', 'id', 'u.nome'] ) ->joinInner( ['c' => 'tb_corretores'], 'u.corretor_id = c.id', [] ) ->joinLeft( ['fp' => 'tb_folha_ponto'], "f.id = fp.funcionario_id " . "AND (DATE_FORMAT(data_ponto, '%Y-%m') = '{$dataInicial}' AND data_ponto <= '{$dataAtual}') " . "AND fp.excluido <> 1", ['dias_trabalhados' => 'COUNT(fp.id)'] ) ->where('c.corretor_desativado <> 1') ->where("f.excluido <> 1 AND grupo_id IN(?)", Model_GrupoUsuario::getIdCallcenter()) ->where('u.excluido <> 1') ->group('u.id') ->group('f.id') ->order('agente'); return $this->getAdapter()->fetchAll($select); } }
💾 保存文件
← 返回文件管理器