Skip to content

Commit 35481dc

Browse files
committed
修正当模型定义了const UPDATED_AT = null;时批量更新导致的额外添加了更新时间导致的异常错误
1 parent 1170ca2 commit 35481dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Batch.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function update(Model $table, array $values, string $index = null, bool $
7373
if ($table->usesTimestamps()) {
7474
$updatedAtColumn = $table->getUpdatedAtColumn();
7575

76-
if (!isset($val[$updatedAtColumn])) {
76+
if ($updatedAtColumn && !isset($val[$updatedAtColumn])) {
7777
$val[$updatedAtColumn] = Carbon::now()->format($table->getDateFormat());
7878
}
7979
}

0 commit comments

Comments
 (0)