src/Leevel/Database/Select.php
public function value(string $field, bool $flag = false)
    {
        $this
            ->condition
            ->setColumns($field)
            ->one();

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

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

        return $result[$field] ?? null;
    }
public function value(string $field, bool $flag = false)
    {
        $this
            ->condition
            ->setColumns($field)
            ->one();

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

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

        return $result[$field] ?? null;
    }
返回一个字段的值

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

@return mixed