src/Leevel/Database/Condition.php
protected function normalizeBindData(array $data, array $bind = [], int $questionMark = 0, int $index = 0): array
    {
        $fields = $values = [];
        $tableName = $this->getTable();

        foreach ($data as $key => $value) {
            // 表达式支持
            if (is_string($value) && false !== strpos($value, '{') &&
                preg_match('/^{(.+?)}$/', $value, $matches)) {
                $value = $this->connect->normalizeExpression(
                    $matches[1],
                    $tableName
                );
            } else {
                $value = $this->connect->normalizeColumnValue($value, false);
            }

            // 字段
            if (0 === $index) {
                $fields[] = $key;
            }

            if ((is_string($value) && 0 === strpos($value, ':')) || !empty($matches)) {
                $values[] = $value;
            } else {
                // 转换 ? 占位符至 : 占位符
                if ('?' === $value && isset($bind[$questionMark])) {
                    $key = 'questionmark_'.$questionMark;
                    $value = $bind[$questionMark];
                    unset($bind[$questionMark]);

                    $this->deleteBindParams($questionMark);
                    $questionMark++;
                }

                if ($index > 0) {
                    $key = $key.'_'.$index;
                }

                $values[] = ':'.$key;

                $this->bind($key, $value, $this->connect->normalizeBindParamType($value));
            }
        }

        return [
            $fields,
            $values,
            $bind,
            $questionMark,
        ];
    }
protected function normalizeBindData(array $data, array $bind = [], int $questionMark = 0, int $index = 0): array
    {
        $fields = $values = [];
        $tableName = $this->getTable();

        foreach ($data as $key => $value) {
            // 表达式支持
            if (is_string($value) && false !== strpos($value, '{') &&
                preg_match('/^{(.+?)}$/', $value, $matches)) {
                $value = $this->connect->normalizeExpression(
                    $matches[1],
                    $tableName
                );
            } else {
                $value = $this->connect->normalizeColumnValue($value, false);
            }

            // 字段
            if (0 === $index) {
                $fields[] = $key;
            }

            if ((is_string($value) && 0 === strpos($value, ':')) || !empty($matches)) {
                $values[] = $value;
            } else {
                // 转换 ? 占位符至 : 占位符
                if ('?' === $value && isset($bind[$questionMark])) {
                    $key = 'questionmark_'.$questionMark;
                    $value = $bind[$questionMark];
                    unset($bind[$questionMark]);

                    $this->deleteBindParams($questionMark);
                    $questionMark++;
                }

                if ($index > 0) {
                    $key = $key.'_'.$index;
                }

                $values[] = ':'.$key;

                $this->bind($key, $value, $this->connect->normalizeBindParamType($value));
            }
        }

        return [
            $fields,
            $values,
            $bind,
            $questionMark,
        ];
    }
分析绑定参数数据.

@param array $data
@param array $bind
@param int   $questionMark
@param int   $index

@return array