src/Leevel/Database/Select.php
protected function findAggregateResult(string $method, string $field, string $alias, bool $flag = false)
    {
        $this->condition->{$method}($field, $alias);

        $result = $this
            ->safeSql($flag)
            ->asDefault()
            ->query();

        if (true === $this->onlyMakeSql) {
            return $result;
        }

        return is_object($result) ? $result->{$alias} : $result[$alias];
    }
protected function findAggregateResult(string $method, string $field, string $alias, bool $flag = false)
    {
        $this->condition->{$method}($field, $alias);

        $result = $this
            ->safeSql($flag)
            ->asDefault()
            ->query();

        if (true === $this->onlyMakeSql) {
            return $result;
        }

        return is_object($result) ? $result->{$alias} : $result[$alias];
    }
获取聚合结果.

@param string $method
@param string $field
@param string $alias
@param bool   $flag   指示是否不做任何操作只返回 SQL

@return mixed