Add temp beacon reassign script
This commit is contained in:
parent
85f64c2add
commit
867e1c8a78
1 changed files with 22 additions and 0 deletions
22
api/beacons/reassign_all.cfm
Normal file
22
api/beacons/reassign_all.cfm
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
<cfsetting showdebugoutput="false">
|
||||||
|
<cfsetting enablecfoutputonly="true">
|
||||||
|
<cfcontent type="application/json; charset=utf-8" reset="true">
|
||||||
|
|
||||||
|
<cftry>
|
||||||
|
<cfset targetBusinessID = 44>
|
||||||
|
|
||||||
|
<cfquery name="qUpdate" datasource="payfrit">
|
||||||
|
UPDATE Beacons
|
||||||
|
SET BeaconBusinessID = <cfqueryparam cfsqltype="cf_sql_integer" value="#targetBusinessID#">
|
||||||
|
</cfquery>
|
||||||
|
|
||||||
|
<cfquery name="qCount" datasource="payfrit">
|
||||||
|
SELECT COUNT(*) AS cnt FROM Beacons WHERE BeaconBusinessID = <cfqueryparam cfsqltype="cf_sql_integer" value="#targetBusinessID#">
|
||||||
|
</cfquery>
|
||||||
|
|
||||||
|
<cfoutput>#serializeJSON({ "OK": true, "MESSAGE": "All beacons reassigned to BusinessID #targetBusinessID#", "COUNT": qCount.cnt })#</cfoutput>
|
||||||
|
|
||||||
|
<cfcatch type="any">
|
||||||
|
<cfoutput>#serializeJSON({ "OK": false, "ERROR": cfcatch.message })#</cfoutput>
|
||||||
|
</cfcatch>
|
||||||
|
</cftry>
|
||||||
Loading…
Add table
Reference in a new issue