Update Driver.php

修改模型类中使用addAll方法时,第三个replace参数无效问题
This commit is contained in:
5ini99
2016-02-09 09:18:35 +08:00
parent e7a5e6ae01
commit eec306d4cf

View File

@@ -960,7 +960,7 @@ abstract class Driver
}
$values[] = 'SELECT ' . implode(',', $value);
}
$sql = 'INSERT INTO ' . $this->parseTable($options['table']) . ' (' . implode(',', $fields) . ') ' . implode(' UNION ALL ', $values);
$sql = (true === $replace ? 'REPLACE' : 'INSERT') . ' INTO ' . $this->parseTable($options['table']) . ' (' . implode(',', $fields) . ') ' . implode(' UNION ALL ', $values);
$sql .= $this->parseComment(!empty($options['comment']) ? $options['comment'] : '');
return $this->execute($sql, $this->getBindParams(true), !empty($options['fetch_sql']) ? true : false);
}