src/DB/SQLAssembler/SQLAssembler.php
public function add($table, &$data, $multi = false)
    {
        $params = array();
        if (true === $multi) {
            $field_str = $value_str = '';
            if (empty($data['fields']) || empty($data['values'])) {
                $data = $this->arrayToMultiAddFormat($data);
            }

            $params = $data['values'];
            foreach ($data['fields'] as $d) {
                $field_str .= "`{$d}`,";
                $value_str .= '?,';
            }

            $fields = trim($field_str, ',');
            $values = trim($value_str, ',');
            $into_fields = "({$fields}) VALUES ({$values})";
        } else {
            $into_fields = $this->parseData($data, $params, 'insert');
        }

        $this->setSQL("INSERT INTO {$table} {$into_fields}");
        $this->setParams($params);
    }
public function add($table, &$data, $multi = false)
    {
        $params = array();
        if (true === $multi) {
            $field_str = $value_str = '';
            if (empty($data['fields']) || empty($data['values'])) {
                $data = $this->arrayToMultiAddFormat($data);
            }

            $params = $data['values'];
            foreach ($data['fields'] as $d) {
                $field_str .= "`{$d}`,";
                $value_str .= '?,';
            }

            $fields = trim($field_str, ',');
            $values = trim($value_str, ',');
            $into_fields = "({$fields}) VALUES ({$values})";
        } else {
            $into_fields = $this->parseData($data, $params, 'insert');
        }

        $this->setSQL("INSERT INTO {$table} {$into_fields}");
        $this->setParams($params);
    }
插入

@param string $table 表名称
@param array $data 要处理的数据关联数组
@param bool $multi 是否批量插入数据
<pre>
批量插入数据时$data的结构如下:
$data = array(
'fields' => array(字段1,字段2,...),
'values' => array(
array(字段1的值, 字段2的值),
array(字段1的值, 字段2的值))
);
</pre>