✏️ 正在编辑: GerenteRota.php
路径:
/srv/systems_dir/yuppiecred-lidernegocios/application/models/DbTable/GerenteRota.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Model_DbTable_GerenteRota extends Core_DbTable { protected $_primary = 'id'; protected $_name = 'tb_gerente_rota'; protected static $_viewName = 'vw_gerente_rota'; protected $_dependentTables = array( 'Model_DbTable_Corretor' ); protected $_referenceMap = array( 'Gerente' => array( 'columns' => array( 'gerente_id' ), 'refTableClass' => 'Model_DbTable_Gerente', 'refColumns' => array( 'id' ) ), 'BancoFebraban' => array( 'columns' => array( 'banco' ), 'refTableClass' => 'Model_DbTable_BancoFebraban', 'refColumns' => array( 'codigo' ) ) ); public static function getViewName() { return self::$_viewName; } public function update(array $data, $where, $registerLog = true) { if( isset($data['senha']) ){ if( (empty($data['senha']) || $data['senha'] == null ) ){ unset($data['senha']); } else { $data['senha'] = md5($data['senha']); } } return parent::update($data, $where); } public function fetchAll($where = null, $order = null, $count = null, $offset = null) { $and = ""; if( Yuppie_Auth::getIdentity()->grupo == "Gerente Regional" ){ $and .= " AND gerente_id = " . Yuppie_Auth::getIdentity()->id; } if( ($where instanceof Zend_Db_Table_Select ) ){ $strWhere = "excluido<>1 " . $and; foreach ( $where->getPart(Zend_Db_Table_Select::WHERE) as $w ) { $strWhere .= " AND " . $w; } $where->where($strWhere . $and); } elseif( $where != null ){ $where = $where . " AND excluido<>1 " . $and; } else { $where = "excluido<>1 " . $and; } return parent::fetchAll($where, $order, $count, $offset); } }
💾 保存文件
← 返回文件管理器