This commit is contained in:
2026-01-21 23:57:59 +01:00
parent 274d8b1703
commit 8a776e1dc3

View File

@@ -1113,9 +1113,12 @@ class ApiKernel
if (!$stmt->fetch()) $this->fail('Not found', ['id' => $contentId], 404);
}
$cols = $this->resolveContentVersionColumns($table);
$select = ['`id`','`content_id`','`section_id`','`version_no`','`editor_type`','`created_at`'];
if (!empty($cols['is_active'])) $select[] = "`{$cols['is_active']}` AS is_active";
if (!empty($cols['was_active'])) $select[] = "`{$cols['was_active']}` AS was_active";
$stmt = $this->pdo->prepare(
"SELECT `id`,`content_id`,`section_id`,`version_no`,`editor_type`,`created_at`
FROM `$table` WHERE `customer_id` = :cid AND `content_id` = :content
"SELECT " . implode(',', $select) . " FROM `$table` WHERE `customer_id` = :cid AND `content_id` = :content
ORDER BY `id` DESC LIMIT 10"
);
$stmt->execute([':cid' => $customerId, ':content' => $contentId]);