between语句

@param string $column
@param mixed  $min
@param mixed  $max
@param string $connector

@return QueryBuilder
351096
public function whereBetween(string $column, $min, $max, string $connector = self::LOGICAL_AND): self
    {
        $this->criteria($this->where, $column, [$min, $max], self::BETWEEN, $connector);

        return $this;
    }
466219
public function whereBetween($attribute, $min, $max)
    {
        return $this->addFilter(function (Store $store) use ($attribute, $min, $max) {
            $current = $store->get($attribute);
            if ($current instanceof \DateTime) {
                return (new Carbon($current))->between(new Carbon($min), new Carbon($max));
            }

            return $current >= $min && $current <= $max;
        });
    }
210250
public function whereBetween($column, array $range, $boolean = 'and')
    {

        if (count($range) !== 2) {
            throw new QueryBuilderException(
                'Parameter 2 must be contains two values.',
                E_ERROR
            );
        }

        $between = implode(' and ', $range);

        if (is_null($this->where)) {
            if ($boolean == 'not') {
                $this->where = '(`' . $column.'` not between ' . $between . ')';
            } else {
                $this->where = '(`' . $column . '` between ' . $between . ')';
            }
        } else {
            if ($boolean == 'not') {
                $this->where .= ' and (`'.$column .'` not between ' . $between . ')';
            } else {
                $this->where .= ' ' . $boolean . ' (`' . $column. '` between ' . $between . ')';
            }
        }

        return $this;
    }
15237
public static function between($n, $min, $max, $inclusive = true){
		
		if($inclusive){
			return static::greaterThanOrEqualTo($n, $min) &&
					static::lessThanOrEqualTo($n, $max);
		}
		
		return static::greaterThan($n, $min) &&
				static::lessThan($n, $$max);
		
	}
1036927
public function orHavingBetween(string $column, int $min, int $max)
    {
        $this->hConditions()->orBetween(...func_get_args());

        return $this;
    }
1192626
public function whereDateBetween($field, $min, $max)
    {
        if (!$this->_model) {
            throw new MisuseException('use whereDateBetween must provide model');
        }

        if ($min && strpos($min, ':') === false) {
            $min = (int)(is_numeric($min) ? $min : strtotime($min . ' 00:00:00'));
        }
        if ($max && strpos($max, ':') === false) {
            $max = (int)(is_numeric($max) ? $max : strtotime($max . ' 23:59:59'));
        }

        if ($format = $this->_model->getDateFormat($field)) {
            if (is_int($min)) {
                $min = date($format, $min);
            }
            if (is_int($max)) {
                $max = date($format, $max);
            }
        } else {
            if ($min && !is_int($min)) {
                $min = (int)strtotime($min);
            }
            if ($max && !is_int($max)) {
                $max = (int)strtotime($max);
            }
        }

        return $this->whereBetween($field, $min ?: null, $max ?: null);
    }
934801
protected function addWhereBetween(string $key, int $min, int $max): void
    {
        $phMin = $this->addBindingValue($key, $min);
        $phMax = $this->addBindingValue($key, $max);
        $key = $this->quoteName($key);
        $this->statement .= sprintf('%s BETWEEN %s AND %s', $key, $phMin, $phMax);
        $this->statement .= PHP_EOL;
    }
1187935
public function min($field) {
        $this->statementContext->setFields("MIN({$field}) AS __MIN__");
        $row = $this->findOne();

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

        return $row['__MIN__'];
    }
745165
public static function where($column, $value)
    {
        try {
            self::init();
            $query = 'SELECT * FROM ' . self::$modelTable . ' WHERE '. $column. ' = '. $value;
            return new QueryBuilder(self::$connect, $query);

        } catch (\Exception $exception) {
            var_dump($exception->getMessage());
        }
    }
1251055
public static Integer max(Connection connection, String table,
			String column, String where, String[] args) {

		Integer max = null;
		if (count(connection, table, where, args) > 0) {
			StringBuilder maxQuery = new StringBuilder();
			maxQuery.append("select max(")
					.append(CoreSQLUtils.quoteWrap(column)).append(") from ")
					.append(CoreSQLUtils.quoteWrap(table));
			if (where != null) {
				maxQuery.append(" where ").append(where);
			}
			String sql = maxQuery.toString();

			max = querySingleInteger(connection, sql, args, false);
		}

		return max;
	}
283912
public function whereNotBetween(string $column, int $min, int $max)
    {
        $this->wConditions()->notBetween(...func_get_args());

        return $this;
    }
1186096
public function havingNotIn($column, array $values, $connector = self::LOGICAL_AND, $quote = null)
    {
        return $this->criteriaNotIn($this->having, $column, $values, $connector, $quote);
    }
254597
protected function whereBetween(Builder $query, $where)
    {
        $between = $where['not'] ? 'not between' : 'between';

        $min = $this->parameter(reset($where['values']));

        $max = $this->parameter(end($where['values']));

        return $this->wrap($where['column']).' '.$between.' '.$min.' and '.$max;
    }
404545
public function andBetween($key, $min, $max)
    {
        $value = sprintf('%s BETWEEN ? AND ?', $key);
        return $this->andAdd($value, [$min, $max]);
    }
1066969
public function between($min, $max, $msg)
    {
        $this->min($min, $msg);
        $this->max($max, $msg);
        return $this;
    }
695851
public function notBetween(string $column, $min, $max, $dataType = PDO::PARAM_STR) : NotBetweenCondition
    {
        return new NotBetweenCondition($column, $min, $max, $dataType);
    }
437596
public static function max($column)
    {
        $self      = self::getInstance();
        
        if (empty($self->optionSelect)) {
            $self->optionSelect = "MAX({$column})";
        } else {
            $self->optionSelect .= ",MAX({$column})";
        }
        

        $statement = $self->makeSelect();
        $execute   = $self->exec($statement, []);

        return $execute->fetchObject();
    }