feat: improve notiz column UI and fix memory exhaustion

Notiz column now has max 5 lines with expand/collapse animation and auto-resizing edit textarea. Moved raw SQL query to WorkorderModel::getPreorderIdsByCampaigns() to fix OOM in archiveWorkorders().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 15:35:17 +01:00
parent a53ff3912c
commit 6593e921ee
5 changed files with 116 additions and 21 deletions

View File

@@ -201,6 +201,17 @@ class WorkorderModel extends TTCrudBaseModel
return $result ? $result->fetch_assoc()['count'] : 0;
}
public static function getPreorderIdsByCampaigns(array $campaignIds): array {
if (empty($campaignIds)) return [];
$db = self::getDB();
$campaignIdList = implode(',', array_map('intval', $campaignIds));
$result = $db->query("SELECT id FROM `" . FRONKDB_DBNAME . "`.`Preorder` WHERE preordercampaign_id IN ($campaignIdList)");
if (!$result || $result->num_rows === 0) return [];
$ids = array_column($result->fetch_all(MYSQLI_ASSOC), 'id');
$result->free();
return $ids;
}
public static function getTechnicalData(int $workorderId): ?array {
$workorder = self::get($workorderId);
if (!$workorder || !$workorder->preorderId) return null;