diff --git a/helpers/lotOccupancyDB/getLotOccupancies.js b/helpers/lotOccupancyDB/getLotOccupancies.js index 701203bd..bfcb3622 100644 --- a/helpers/lotOccupancyDB/getLotOccupancies.js +++ b/helpers/lotOccupancyDB/getLotOccupancies.js @@ -124,7 +124,7 @@ export const getLotOccupancies = (filters, options, connectedDatabase) => { " left join LotTypes lt on l.lotTypeId = lt.lotTypeId" + " left join Maps m on l.mapId = m.mapId" + sqlWhereClause + - " order by o.occupancyStartDate desc, ifnull(o.occupancyEndDate, 99999999) desc, l.lotName, o.lotId" + + " order by o.occupancyStartDate desc, ifnull(o.occupancyEndDate, 99999999) desc, l.lotName, o.lotId, o.lotOccupancyId desc" + (options.limit === -1 ? "" : " limit " + options.limit + " offset " + options.offset)) diff --git a/helpers/lotOccupancyDB/getLotOccupancies.ts b/helpers/lotOccupancyDB/getLotOccupancies.ts index 06dc0178..e861fc1b 100644 --- a/helpers/lotOccupancyDB/getLotOccupancies.ts +++ b/helpers/lotOccupancyDB/getLotOccupancies.ts @@ -192,7 +192,7 @@ export const getLotOccupancies = ( " left join LotTypes lt on l.lotTypeId = lt.lotTypeId" + " left join Maps m on l.mapId = m.mapId" + sqlWhereClause + - " order by o.occupancyStartDate desc, ifnull(o.occupancyEndDate, 99999999) desc, l.lotName, o.lotId" + + " order by o.occupancyStartDate desc, ifnull(o.occupancyEndDate, 99999999) desc, l.lotName, o.lotId, o.lotOccupancyId desc" + (options.limit === -1 ? "" : " limit " + options.limit + " offset " + options.offset)