Skip to content

Commit

Permalink
fix: deleteBatch() Postgre type error
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Jan 25, 2024
1 parent fcf5384 commit bec6422
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions system/Database/Postgre/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ protected function _deleteBatch(string $table, array $keys, array $values): stri

$sql .= ') ' . $alias . "\n";

$that = $this;
$sql .= 'WHERE ' . implode(
' AND ',
array_map(
Expand All @@ -570,8 +571,8 @@ protected function _deleteBatch(string $table, array $keys, array $values): stri
$value :
(
is_string($key) ?
$table . '.' . $key . ' = ' . $alias . '.' . $value :
$table . '.' . $value . ' = ' . $alias . '.' . $value
$table . '.' . $key . ' = ' . $that->cast($alias . '.' . $value, $that->getFieldType($table, $key)) :
$table . '.' . $value . ' = ' . $that->cast($alias . '.' . $value, $that->getFieldType($table, $key))
)
),
array_keys($constraints),
Expand Down

0 comments on commit bec6422

Please sign in to comment.