From 07a10f5de1e5ac214839506b7eb026cf2e2aa614 Mon Sep 17 00:00:00 2001 From: Dan Gowans Date: Wed, 28 Dec 2022 13:23:50 -0500 Subject: [PATCH] fix order --- helpers/lotOccupancyDB/getLotOccupancies.js | 2 +- helpers/lotOccupancyDB/getLotOccupancies.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)