diff --git a/api/businesses/get.cfm b/api/businesses/get.cfm index d4c0f26..b7fb522 100644 --- a/api/businesses/get.cfm +++ b/api/businesses/get.cfm @@ -88,11 +88,11 @@ try { // Get hours from Hours table qHours = queryExecute(" - SELECT h.HoursDayID, h.HoursOpenTime, h.HoursClosingTime, d.tt_DayAbbrev AS Abbrev + SELECT h.DayID, h.OpenTime, h.ClosingTime, d.Abbrev FROM Hours h - JOIN tt_Days d ON d.tt_DayID = h.HoursDayID - WHERE h.HoursBusinessID = :businessID - ORDER BY h.HoursDayID + JOIN tt_Days d ON d.ID = h.DayID + WHERE h.BusinessID = :businessID + ORDER BY h.DayID ", { businessID: businessID }, { datasource: "payfrit" }); hoursArr = []; @@ -101,9 +101,9 @@ try { for (h in qHours) { arrayAppend(hoursArr, { "day": h.Abbrev, - "dayId": h.HoursDayID, - "open": timeFormat(h.HoursOpenTime, "h:mm tt"), - "close": timeFormat(h.HoursClosingTime, "h:mm tt") + "dayId": h.DayID, + "open": timeFormat(h.OpenTime, "h:mm tt"), + "close": timeFormat(h.ClosingTime, "h:mm tt") }); } // Build readable hours string (group similar days)