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": []
|
"TableMembers": []
|
||||||
}>
|
}>
|
||||||
|
|
||||||
<!--- Get beacon sharding info from BeaconHardware (for auto-completion on Works app) --->
|
<!--- Get beacon sharding info (for auto-completion on Works app) --->
|
||||||
<!--- BeaconHardware stores: ShardUUID, Major, Minor for each registered beacon --->
|
<!--- Sharding: UUID from BeaconShards, Major from Businesses.BeaconMajor, Minor from ServicePoints.BeaconMinor --->
|
||||||
<cfif val(qTask.ServicePointID) GT 0>
|
<cfif val(qTask.ServicePointID) GT 0>
|
||||||
<cfset qBeacon = queryExecute("
|
<cfset qBeacon = queryExecute("
|
||||||
SELECT bh.ShardUUID, bh.Major, bh.Minor
|
SELECT bs.UUID AS ShardUUID, b.BeaconMajor, sp.BeaconMinor
|
||||||
FROM BeaconHardware bh
|
FROM ServicePoints sp
|
||||||
WHERE bh.ServicePointID = ?
|
JOIN Businesses b ON b.ID = sp.BusinessID
|
||||||
AND bh.Status IN ('assigned', 'verified')
|
JOIN BeaconShards bs ON bs.ID = b.BeaconShardID
|
||||||
|
WHERE sp.ID = ?
|
||||||
|
AND bs.IsActive = 1
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
", [ { value = qTask.ServicePointID, cfsqltype = "cf_sql_integer" } ], { datasource = "payfrit" })>
|
", [ { value = qTask.ServicePointID, cfsqltype = "cf_sql_integer" } ], { datasource = "payfrit" })>
|
||||||
<cfif qBeacon.recordCount GT 0>
|
<cfif qBeacon.recordCount GT 0>
|
||||||
<cfset result.BeaconUUID = qBeacon.ShardUUID>
|
<cfset result.BeaconUUID = qBeacon.ShardUUID>
|
||||||
<cfset result.BeaconMajor = val(qBeacon.Major)>
|
<cfset result.BeaconMajor = val(qBeacon.BeaconMajor)>
|
||||||
<cfset result.BeaconMinor = val(qBeacon.Minor)>
|
<cfset result.BeaconMinor = val(qBeacon.BeaconMinor)>
|
||||||
</cfif>
|
</cfif>
|
||||||
</cfif>
|
</cfif>
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue