Fix column names: Latitude/Longitude not Lat/Lng
The Addresses table uses Latitude and Longitude column names, not Lat and Lng. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
4e0cc65ba2
commit
ff24cfa79b
2 changed files with 8 additions and 8 deletions
|
|
@ -39,8 +39,8 @@
|
|||
<cfset geo = geocodeAddress(fullAddress)>
|
||||
<cfif geo.success>
|
||||
<cfquery datasource="payfrit">
|
||||
UPDATE Addresses SET Lat = <cfqueryparam value="#geo.lat#" cfsqltype="cf_sql_decimal">,
|
||||
Lng = <cfqueryparam value="#geo.lng#" cfsqltype="cf_sql_decimal">
|
||||
UPDATE Addresses SET Latitude = <cfqueryparam value="#geo.lat#" cfsqltype="cf_sql_decimal">,
|
||||
Longitude = <cfqueryparam value="#geo.lng#" cfsqltype="cf_sql_decimal">
|
||||
WHERE ID = <cfqueryparam value="#addressId#" cfsqltype="cf_sql_integer">
|
||||
</cfquery>
|
||||
<cfoutput><div class="success">Geocoded Address ID #addressId#: #geo.lat#, #geo.lng#</div></cfoutput>
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
<cfquery name="missing" datasource="payfrit">
|
||||
SELECT ID, Line1, Line2, City, ZIPCode
|
||||
FROM Addresses
|
||||
WHERE (Lat IS NULL OR Lat = 0)
|
||||
WHERE (Latitude IS NULL OR Latitude = 0)
|
||||
AND Line1 IS NOT NULL AND Line1 != ''
|
||||
</cfquery>
|
||||
<cfset successCount = 0>
|
||||
|
|
@ -64,8 +64,8 @@
|
|||
<cfset geo = geocodeAddress(fullAddress)>
|
||||
<cfif geo.success>
|
||||
<cfquery datasource="payfrit">
|
||||
UPDATE Addresses SET Lat = <cfqueryparam value="#geo.lat#" cfsqltype="cf_sql_decimal">,
|
||||
Lng = <cfqueryparam value="#geo.lng#" cfsqltype="cf_sql_decimal">
|
||||
UPDATE Addresses SET Latitude = <cfqueryparam value="#geo.lat#" cfsqltype="cf_sql_decimal">,
|
||||
Longitude = <cfqueryparam value="#geo.lng#" cfsqltype="cf_sql_decimal">
|
||||
WHERE ID = <cfqueryparam value="#missing.ID#" cfsqltype="cf_sql_integer">
|
||||
</cfquery>
|
||||
<cfset successCount = successCount + 1>
|
||||
|
|
@ -86,8 +86,8 @@
|
|||
a.Line2,
|
||||
a.City,
|
||||
a.ZIPCode,
|
||||
a.Lat AS Latitude,
|
||||
a.Lng AS Longitude
|
||||
a.Latitude,
|
||||
a.Longitude
|
||||
FROM Businesses b
|
||||
LEFT JOIN Addresses a ON b.AddressID = a.ID
|
||||
ORDER BY b.Name
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ function geocodeAddressById(addressId) {
|
|||
|
||||
if (geo.success) {
|
||||
queryExecute("
|
||||
UPDATE Addresses SET Lat = :lat, Lng = :lng WHERE ID = :id
|
||||
UPDATE Addresses SET Latitude = :lat, Longitude = :lng WHERE ID = :id
|
||||
", {
|
||||
lat: { value: geo.lat, cfsqltype: "cf_sql_decimal" },
|
||||
lng: { value: geo.lng, cfsqltype: "cf_sql_decimal" },
|
||||
|
|
|
|||
Reference in a new issue