public function get_or($fields)
    {
        $args = array();
        $fieldsValue = $fields;
        $fields = $this->getFields();
        $sql = '';
        foreach ($fields as $field) {
            if (isset($fieldsValue[$field])) {
                $value = $fieldsValue[$field];
                if (is_array($value)) {
                    foreach ($value as $subvalue) {
                        $sql .= '`' . $field . '` = ? OR ';
                        $args[] = $subvalue;
                    }
                } else {
                    $sql .= '`' . $field . '` = ? OR ';
                    $args[] = $value;
                }
            }
        }
        if (!empty($sql)) {
            $sql = substr($sql, 0, -4);
            return $this->build($this->db->select('SELECT * FROM `' . $this->table_name . '` WHERE ' . $sql, $args));
        }
        return $this->build(array());
    }
public function get_or($fields)
    {
        $args = array();
        $fieldsValue = $fields;
        $fields = $this->getFields();
        $sql = '';
        foreach ($fields as $field) {
            if (isset($fieldsValue[$field])) {
                $value = $fieldsValue[$field];
                if (is_array($value)) {
                    foreach ($value as $subvalue) {
                        $sql .= '`' . $field . '` = ? OR ';
                        $args[] = $subvalue;
                    }
                } else {
                    $sql .= '`' . $field . '` = ? OR ';
                    $args[] = $value;
                }
            }
        }
        if (!empty($sql)) {
            $sql = substr($sql, 0, -4);
            return $this->build($this->db->select('SELECT * FROM `' . $this->table_name . '` WHERE ' . $sql, $args));
        }
        return $this->build(array());
    }
public function get_or ( $ fields ) { $ args = array ( ) ; $ fieldsValue = $ fields ; $ fields = $ this -> getFields ( ) ; $ sql = '' ; foreach ( $ fields as $ field ) { if ( isset ( $ fieldsValue [ $ field ] ) ) { $ value = $ fieldsValue [ $ field ] ; if ( is_array ( $ value ) ) { foreach ( $ value as $ subvalue ) { $ sql .= '`' . $ field . '` = ? OR ' ; $ args [ ] = $ subvalue ; } } else { $ sql .= '`' . $ field . '` = ? OR ' ; $ args [ ] = $ value ; } } } if ( ! empty ( $ sql ) ) { $ sql = substr ( $ sql , 0 , - 4 ) ; return $ this -> build ( $ this -> db -> select ( 'SELECT * FROM `' . $ this -> table_name . '` WHERE ' . $ sql , $ args ) ) ; } return $ this -> build ( array ( ) ) ; }
Obtener el modelo de la base de datos con condiciones disyuntivas

@param $fields
@return ModelResult
@throws \Exception
Obtener el modelo de la base de datos con condiciones disyuntivas