获取最小值
@param  [type] $field [description]
@return [type]        [description]
357162
public function min($field) {
        $this->build()->bindExpression('field', "min({$field}) AS m");
        $data = $this->first();

        return $data ? $data['m'] : '';
    }
201347
public function errorString($field = null)
    {
        $res = [];
        $errors = $this->errors();
        foreach ($errors as $k => $v) {
            $res[$k] = implode(',', $v);
        }
        if (!empty($field)) {
            return Arrays::get($res, $field, '');
        }

        return implode('|', $res);
    }
645935
private function parseSegments($field)
    {
        $segments = explode(':', $field);

        $name = array_shift($segments);
        $argument = $segments[0];

        return compact('name', 'argument');

    }
88565
public function allowField($field)
    {
        if (is_string($field)) {
            $field = explode(',', $field);
        }

        $this->field = $field;

        return $this;
    }
392213
public function getMaxLength($field)
    {
        if (!is_array($this->_context['schema'])) {
            return null;
        }

        return Hash::get($this->_context['schema'], "$field.length");
    }
742071
private function getJqFilterField($field)
    {
        if (!isset($this->jqFilterFields) || !is_array($this->jqFilterFields)) {
            $this->jqFilterFields = $this->jqSearchable;
        }

        if (!isset($this->jqFilterFields) || !is_array($this->jqFilterFields)) {
            return $field;
        }

        return isset($this->jqFilterFields[$field]) ? $this->jqFilterFields[$field] : $field;
    }
602596
public function localizeField($field) {
        $re = "/(?:[-])(".$this->multilingual_parameters['default_language'].")(?:[-])/";
        $language = "-".$this->languageDetection()."-";
        $field = preg_replace($re, $language,$field);
        return $field;
    }
189617
protected static function filter($field)
    {
        $field = preg_replace('/[\.\/\\:;,?$*!#_-]/', '', $field);
        $field = preg_replace('/\s+/', ' ', trim($field));
        return $field;
    }
685553
public function field($field,$except=false){
        if(true === $field) {// 获取全部字段
            $fields     =  $this->getDbFields();
            $field      =  $fields?:'*';
        }elseif($except) {// 字段排除
            if(is_string($field)) {
                $field  =  explode(',',$field);
            }
            $fields     =  $this->getDbFields();
            $field      =  $fields?array_diff($fields,$field):$field;
        }
        $this->options['field']   =   $field;
        return $this;
    }
39655
public function sum($field) {
        $this->statementContext->setFields("SUM({$field}) AS __SUM__");
        $row = $this->findOne();

        //SQL执行发生错误
        if ($row === false) {
            return false;
        }

        return $row['__SUM__'];
    }
523585
public function field($field)
    {
        return $this->fieldFactory->createFromField(
            $this->getFieldData($field),
            $this->getFieldValue($field)
        );
    }
1041386
public function remove_prefix($field) {
        if (preg_match('~^(-?_?)' . preg_quote($this->extraprefix, '~') . '(.*)$~', $field, $matches)) {
            return $matches[1] . $matches[2];
        } else {
            return null;
        }
    }
845754
private function getCommonType($field)
    {
        static $types = [
            // MYSQLI_TYPE_BIT => CommonTypes::T,
            MYSQLI_TYPE_BLOB => CommonTypes::TTEXT,
            // MYSQLI_TYPE_CHAR => CommonTypes::TINT, // MYSQLI_TYPE_TINY is the same as MYSQLI_TYPE_CHAR
            MYSQLI_TYPE_DATE => CommonTypes::TDATE,
            MYSQLI_TYPE_DATETIME => CommonTypes::TDATETIME,
            MYSQLI_TYPE_DECIMAL => CommonTypes::TNUMBER,
            MYSQLI_TYPE_DOUBLE => CommonTypes::TNUMBER,
            // MYSQLI_TYPE_ENUM => CommonTypes::T,
            MYSQLI_TYPE_FLOAT => CommonTypes::TNUMBER,
            // MYSQLI_TYPE_GEOMETRY => CommonTypes::T,
            MYSQLI_TYPE_INT24 => CommonTypes::TINT,
            // MYSQLI_TYPE_INTERVAL => CommonTypes::T,
            MYSQLI_TYPE_LONG => CommonTypes::TINT,
            MYSQLI_TYPE_LONGLONG => CommonTypes::TINT,
            MYSQLI_TYPE_LONG_BLOB => CommonTypes::TTEXT,
            MYSQLI_TYPE_MEDIUM_BLOB => CommonTypes::TTEXT,
            MYSQLI_TYPE_NEWDATE => CommonTypes::TDATE,
            MYSQLI_TYPE_NEWDECIMAL => CommonTypes::TNUMBER,
            // MYSQLI_TYPE_NULL => CommonTypes::T,
            // MYSQLI_TYPE_SET => CommonTypes::T,
            MYSQLI_TYPE_SHORT => CommonTypes::TINT,
            MYSQLI_TYPE_STRING => CommonTypes::TTEXT,
            MYSQLI_TYPE_TIME => CommonTypes::TTIME,
            MYSQLI_TYPE_TIMESTAMP => CommonTypes::TINT,
            MYSQLI_TYPE_TINY => CommonTypes::TINT,
            MYSQLI_TYPE_TINY_BLOB => CommonTypes::TTEXT,
            MYSQLI_TYPE_VAR_STRING => CommonTypes::TTEXT,
            MYSQLI_TYPE_YEAR => CommonTypes::TINT,
        ];
        if (isset($this->overrideTypes[$field->{'name'}])) {
            return $this->overrideTypes[$field->{'name'}];
        }
        $type = CommonTypes::TTEXT;
        if (array_key_exists($field->{'type'}, $types)) {
            $type = $types[$field->{'type'}];
            if (1 == $field->{'length'} && ($type == CommonTypes::TINT || $type == CommonTypes::TNUMBER)) {
                $type = CommonTypes::TBOOL;
            } elseif ($type == CommonTypes::TNUMBER && $field->{'decimals'} == 0) {
                $type = CommonTypes::TINT;
            }
        }
        return $type;
    }
922086
public function field($field) {
        $field = is_array($field) ? $field : explode(',', $field);
        foreach ((array) $field as $k => $v) {
            $this->build()->bindExpression('field', $v);
        }

        return $this->connection;
    }
486851
public function get_field_raw( $field ) {
		if ( array_key_exists( $field, $this->prop( 'fields' ) ) ) {
			return $this->prop( 'fields' )[ $field ];
		}

		return null;
	}
338573
public function validator($field, array $data)
    {
        $value = isset($data[$field]) ? $data[$field] : null;
        if ($value === '' || $value === null) {
            return $this->allowEmpty ? true : $this->message('{fieldName}不是整数！', [
                '{fieldName}' => $this->getName($field),
            ], 'emptyMsg');
        }

        if ($this->min !== null && $this->min > $value) {
            return $this->message('{fieldName}不能小于{min}！', [
                '{fieldName}' => $this->getName($field),
                '{min}' => $this->min,
            ], 'tooSmall');
        }

        if ($this->max !== null && $this->max < $value) {
            return $this->message('{fieldName}不能大于{max}！', [
                '{fieldName}' => $this->getName($field),
                '{max}' => $this->max,
            ], 'tooBig');
        }

        if (!preg_match($this->intOnly ? $this->intPattern : $this->numberPattern, $value)) {
            return $this->message('{fieldName}不是' . ($this->intOnly ? '整数' : '数字') . '！', [
                '{fieldName}' => $this->getName($field),
            ]);
        }

        return true;
    }
798208
public function first($field = '')
    {
        if (isset($this->errorMessages[$field])) {
            $message = reset($this->errorMessages[$field]);
        } else {
            $firstMessages = $this->firsts();
            $message = reset($firstMessages);
        }

        return $message;
    }