public function field($field, $alias = null) {
        if (is_string($field)) {
            $fields = explode(',', trim($field));
            foreach ($fields as $field) {
                $this->fields [] = Condition::cleanField($field . ($alias ? ' AS ' . $alias : ''));
            }
        } else if ($field instanceof Query) {
            if ($alias) {
                $field->alias($alias);
            }
            $this->fields [] = $field;
        } else if ($field instanceof ImmutableValue) {
            if ($alias) {
                $field->alias($alias);
            }
            $this->fields [] = $field;
        }

        return $this;
    }
public function field($field, $alias = null) {
        if (is_string($field)) {
            $fields = explode(',', trim($field));
            foreach ($fields as $field) {
                $this->fields [] = Condition::cleanField($field . ($alias ? ' AS ' . $alias : ''));
            }
        } else if ($field instanceof Query) {
            if ($alias) {
                $field->alias($alias);
            }
            $this->fields [] = $field;
        } else if ($field instanceof ImmutableValue) {
            if ($alias) {
                $field->alias($alias);
            }
            $this->fields [] = $field;
        }

        return $this;
    }
public function field ( $ field , $ alias = null ) { if ( is_string ( $ field ) ) { $ fields = explode ( ',' , trim ( $ field ) ) ; foreach ( $ fields as $ field ) { $ this -> fields [ ] = Condition :: cleanField ( $ field . ( $ alias ? ' AS ' . $ alias : '' ) ) ; } } else if ( $ field instanceof Query ) { if ( $ alias ) { $ field -> alias ( $ alias ) ; } $ this -> fields [ ] = $ field ; } else if ( $ field instanceof ImmutableValue ) { if ( $ alias ) { $ field -> alias ( $ alias ) ; } $ this -> fields [ ] = $ field ; } return $ this ; }
append a field to result set.

@param string|Query|\wulaphp\db\sql\ImmutableValue $field
@param string                                      $alias

@return \wulaphp\db\sql\Query
append a field to result set .