Think/Db/Driver.php
public function selectInsert($fields, $table, array $options = [])
    {
        $this->model = $options['model'];
        $this->parseBind(!empty($options['bind']) ? $options['bind'] : []);
        if (is_string($fields)) {
            $fields = explode(',', $fields);
        }
        array_walk($fields, [$this, 'parseKey']);
        $sql = 'INSERT INTO '.$this->parseTable($table).' ('.implode(',', $fields).') ';
        $sql .= $this->buildSelectSql($options);

        return $this->execute($sql, !empty($options['fetch_sql']));
    }
public function selectInsert($fields, $table, array $options = [])
    {
        $this->model = $options['model'];
        $this->parseBind(!empty($options['bind']) ? $options['bind'] : []);
        if (is_string($fields)) {
            $fields = explode(',', $fields);
        }
        array_walk($fields, [$this, 'parseKey']);
        $sql = 'INSERT INTO '.$this->parseTable($table).' ('.implode(',', $fields).') ';
        $sql .= $this->buildSelectSql($options);

        return $this->execute($sql, !empty($options['fetch_sql']));
    }
通过Select方式插入记录
@access   public

@param string $fields 要插入的数据表字段名
@param string $table 要插入的数据表名
@param array $options 查询数据参数

@return false|int