Fix businesses/get.cfm: use un-prefixed dev DB column names

Hours query was still using HoursDayID, HoursOpenTime etc. which
don't exist in payfrit_dev. Now uses DayID, OpenTime, ClosingTime.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-01-31 20:06:37 -08:00
parent 8acf2f3249
commit 4f5ba7f549

View file

@ -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)