Skip to content

Commit bec6422

Browse files
committed
fix: deleteBatch() Postgre type error
1 parent fcf5384 commit bec6422

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

system/Database/Postgre/Builder.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,7 @@ protected function _deleteBatch(string $table, array $keys, array $values): stri
562562

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

565+
$that = $this;
565566
$sql .= 'WHERE ' . implode(
566567
' AND ',
567568
array_map(
@@ -570,8 +571,8 @@ protected function _deleteBatch(string $table, array $keys, array $values): stri
570571
$value :
571572
(
572573
is_string($key) ?
573-
$table . '.' . $key . ' = ' . $alias . '.' . $value :
574-
$table . '.' . $value . ' = ' . $alias . '.' . $value
574+
$table . '.' . $key . ' = ' . $that->cast($alias . '.' . $value, $that->getFieldType($table, $key)) :
575+
$table . '.' . $value . ' = ' . $that->cast($alias . '.' . $value, $that->getFieldType($table, $key))
575576
)
576577
),
577578
array_keys($constraints),

0 commit comments

Comments
 (0)