status fix

This commit is contained in:
2026-10-09 17:22:27 +05:30
parent f0361d8343
commit f6d5c7c87b
2 changed files with 179 additions and 1 deletions

View File

@@ -915,7 +915,13 @@ func (r *tenantRepository) GetTenantByID(tid int, locationid int, userid int) (m
q1 := `
SELECT a.*,b.categoryname,c.locationname AS applocation, d.allocationid AS allocationmode,e.typename AS allocationtype,e.mapid AS allocationid,f.locationid,
f.locationname, f.contactno as locationcontact
f.locationname, f.contactno as locationcontact,
-- Whether the branch is trading today, so the shop profile can show
-- its own switch in the right position. Without these the console
-- reads no value, defaults the switch to open, and a shop that just
-- closed itself looks open again on the next page load.
COALESCE(f.isopen, true) AS isopen,
COALESCE(f.closeduntil::text, '') AS closeduntil
FROM tenants a
LEFT JOIN app_category b ON a.categoryid = b.categoryid
LEFT JOIN app_location c ON a.applocationid = c.applocationid