Model类saveall方法调整参数

This commit is contained in:
thinkphp
2016-08-15 20:02:56 +08:00
parent 2beba43b2e
commit 5912e45669

View File

@@ -729,17 +729,16 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
* 保存多个数据到当前数据对象
* @access public
* @param array $dataSet 数据
* @param bool $replace 是否replace
* @return array|false
*/
public function saveAll($dataSet, $replace = false)
public function saveAll($dataSet)
{
$result = [];
$db = $this->db();
$db->startTrans();
try {
foreach ($dataSet as $key => $data) {
$result[$key] = self::create($data, $replace, false);
$result[$key] = self::create($data);
}
$db->commit();
return $result;