Cabinetes_update alpha v0.935

This commit is contained in:
2026-03-11 17:13:42 +03:00
parent 2c0a7b89b6
commit 72de5d9a71
6 changed files with 1041 additions and 95 deletions

View File

@@ -1888,7 +1888,17 @@ def computers():
c.note, c.date_in_operation, c.date_added
FROM computers c
LEFT JOIN cabinets cab ON cab.id = c.cabinet_id
ORDER BY c.date_added DESC, c.id DESC
ORDER BY
cab.building NULLS LAST,
CASE
WHEN NULLIF(REGEXP_REPLACE(COALESCE(cab.cabinet, cab.name, ''), '\\D', '', 'g'), '') IS NULL THEN 1
ELSE 0
END,
COALESCE(NULLIF(REGEXP_REPLACE(COALESCE(cab.cabinet, cab.name, ''), '\\D', '', 'g'), ''), '0')::INT,
cab.cabinet NULLS LAST,
cab.name NULLS LAST,
c.inventory_number,
c.id
"""
)
rows = cur.fetchall()