mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
try fix error cannot insert multiple commands into prepared statement
This commit is contained in:
@@ -52,12 +52,17 @@ class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface
|
||||
}
|
||||
}
|
||||
|
||||
$sqlDelete = sprintf("delete FROM chill_person_person_center_history WHERE person_id = %d", $from->getId());
|
||||
$sqlDelete = sprintf(<<<'SQL'
|
||||
DELETE FROM chill_person_person_center_history WHERE person_id = %d;
|
||||
SQL, $from->getId());
|
||||
|
||||
$sqlStatements = [$sqlDelete];
|
||||
|
||||
if ((null !== $oldestDateA && null !== $oldestDateB) && $oldestDateA <= $oldestDateB) {
|
||||
$sqlInsert = sprintf("update chill_person_person_center_history set startDate = '%s' WHERE id = %d", $oldestDateA->format('Y-m-d'), $oldestCenterHistoryB->getId());
|
||||
|
||||
$sqlInsert = sprintf(<<<'SQL'
|
||||
UPDATE chill_person_person_center_history SET startDate = '%s' WHERE id = %d;
|
||||
SQL, $oldestDateA->format('Y-m-d'), $oldestCenterHistoryB->getId());
|
||||
|
||||
$sqlStatements = [$sqlInsert, $sqlDelete];
|
||||
}
|
||||
|
Reference in New Issue
Block a user