Fix beacon sharding: use ServicePoints.BeaconMinor not BeaconHardware
Matches the lookup.cfm approach: - UUID from BeaconShards - Major from Businesses.BeaconMajor - Minor from ServicePoints.BeaconMinor Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
957f494ba8
commit
0a08b1da3e
1 changed files with 10 additions and 8 deletions
|
|
@ -133,20 +133,22 @@
|
|||
"TableMembers": []
|
||||
}>
|
||||
|
||||
<!--- Get beacon sharding info from BeaconHardware (for auto-completion on Works app) --->
|
||||
<!--- BeaconHardware stores: ShardUUID, Major, Minor for each registered beacon --->
|
||||
<!--- Get beacon sharding info (for auto-completion on Works app) --->
|
||||
<!--- Sharding: UUID from BeaconShards, Major from Businesses.BeaconMajor, Minor from ServicePoints.BeaconMinor --->
|
||||
<cfif val(qTask.ServicePointID) GT 0>
|
||||
<cfset qBeacon = queryExecute("
|
||||
SELECT bh.ShardUUID, bh.Major, bh.Minor
|
||||
FROM BeaconHardware bh
|
||||
WHERE bh.ServicePointID = ?
|
||||
AND bh.Status IN ('assigned', 'verified')
|
||||
SELECT bs.UUID AS ShardUUID, b.BeaconMajor, sp.BeaconMinor
|
||||
FROM ServicePoints sp
|
||||
JOIN Businesses b ON b.ID = sp.BusinessID
|
||||
JOIN BeaconShards bs ON bs.ID = b.BeaconShardID
|
||||
WHERE sp.ID = ?
|
||||
AND bs.IsActive = 1
|
||||
LIMIT 1
|
||||
", [ { value = qTask.ServicePointID, cfsqltype = "cf_sql_integer" } ], { datasource = "payfrit" })>
|
||||
<cfif qBeacon.recordCount GT 0>
|
||||
<cfset result.BeaconUUID = qBeacon.ShardUUID>
|
||||
<cfset result.BeaconMajor = val(qBeacon.Major)>
|
||||
<cfset result.BeaconMinor = val(qBeacon.Minor)>
|
||||
<cfset result.BeaconMajor = val(qBeacon.BeaconMajor)>
|
||||
<cfset result.BeaconMinor = val(qBeacon.BeaconMinor)>
|
||||
</cfif>
|
||||
</cfif>
|
||||
|
||||
|
|
|
|||
Reference in a new issue