Skip to content

Commit aa2791b

Browse files
sclubricantskenjis
andcommitted
Update system/Database/BaseBuilder.php
Co-authored-by: kenjis <[email protected]>
1 parent 8be5b01 commit aa2791b

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

system/Database/BaseBuilder.php

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,22 +1933,19 @@ protected function _upsertBatch(string $table, array $keys, array $values): stri
19331933
if ($sql === '') {
19341934
$updateFields = $this->QBOptions['updateFields'] ?? $this->updateFields($keys)->QBOptions['updateFields'] ?? [];
19351935

1936-
$sql = 'INSERT INTO ' . $table . ' (' . implode(', ', $keys) . ')' . "\n";
1937-
1938-
$sql .= '{:_table_:}';
1939-
1940-
$sql .= 'ON DUPLICATE KEY UPDATE' . "\n";
1941-
1942-
$sql .= implode(
1943-
",\n",
1944-
array_map(
1945-
static fn ($key, $value) => $table . '.' . $key . ($value instanceof RawSql ?
1946-
' = ' . $value :
1947-
' = ' . 'VALUES(' . $value . ')'),
1948-
array_keys($updateFields),
1949-
$updateFields
1950-
)
1951-
);
1936+
$sql = 'INSERT INTO ' . $table . ' (' . implode(', ', $keys) . ')' . "\n"
1937+
. '{:_table_:}'
1938+
. 'ON DUPLICATE KEY UPDATE' . "\n"
1939+
. implode(
1940+
",\n",
1941+
array_map(
1942+
static fn ($key, $value) => $table . '.' . $key . ($value instanceof RawSql ?
1943+
' = ' . $value :
1944+
' = ' . 'VALUES(' . $value . ')'),
1945+
array_keys($updateFields),
1946+
$updateFields
1947+
)
1948+
);
19521949

19531950
$this->QBOptions['sql'] = $sql;
19541951
}

0 commit comments

Comments
 (0)