diff --git a/api/beacons/lookup.cfm b/api/beacons/lookup.cfm index bff294a..f459859 100644 --- a/api/beacons/lookup.cfm +++ b/api/beacons/lookup.cfm @@ -6,6 +6,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SELECT + biz.ID AS BusinessID, + biz.Name AS BusinessName, + biz.ParentBusinessID, + COALESCE(parent.Name, '') AS ParentBusinessName, + sp.ID AS ServicePointID, + sp.Name AS ServicePointName, + (SELECT COUNT(*) FROM Businesses WHERE ParentBusinessID = biz.ID) AS ChildCount + FROM BeaconShards bs + JOIN Businesses biz ON biz.BeaconShardID = bs.ID AND biz.BeaconMajor = + LEFT JOIN ServicePoints sp ON sp.BusinessID = biz.ID AND sp.BeaconMinor = AND sp.IsActive = 1 + LEFT JOIN Businesses parent ON biz.ParentBusinessID = parent.ID + WHERE bs.UUID = + AND bs.IsActive = 1 + AND biz.IsDemo = 0 + AND biz.IsPrivate = 0 + LIMIT 1 + + + + + + + + #serializeJSON({ + "OK" = true, + "ERROR" = "", + "BEACONS" = beacons + })# + + + + #serializeJSON({ "OK" = true,