Fix header upload: use normalized column names
- HeaderImageExtension -> BusinessHeaderImageExtension - ID -> BusinessID in SELECT query Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
469cc06a29
commit
62c61c13cd
1 changed files with 5 additions and 5 deletions
|
|
@ -49,13 +49,13 @@ if (bizId LTE 0) {
|
||||||
|
|
||||||
<!--- Delete old header if exists --->
|
<!--- Delete old header if exists --->
|
||||||
<cfquery name="qOldHeader" datasource="payfrit">
|
<cfquery name="qOldHeader" datasource="payfrit">
|
||||||
SELECT HeaderImageExtension
|
SELECT BusinessHeaderImageExtension
|
||||||
FROM Businesses
|
FROM Businesses
|
||||||
WHERE ID = <cfqueryparam cfsqltype="cf_sql_integer" value="#bizId#">
|
WHERE BusinessID = <cfqueryparam cfsqltype="cf_sql_integer" value="#bizId#">
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
<cfif qOldHeader.recordCount GT 0 AND len(trim(qOldHeader.HeaderImageExtension)) GT 0>
|
<cfif qOldHeader.recordCount GT 0 AND len(trim(qOldHeader.BusinessHeaderImageExtension)) GT 0>
|
||||||
<cfset oldFile = "#headersDir#/#bizId#.#qOldHeader.HeaderImageExtension#">
|
<cfset oldFile = "#headersDir#/#bizId#.#qOldHeader.BusinessHeaderImageExtension#">
|
||||||
<cfif fileExists(oldFile)>
|
<cfif fileExists(oldFile)>
|
||||||
<cftry>
|
<cftry>
|
||||||
<cffile action="DELETE" file="#oldFile#">
|
<cffile action="DELETE" file="#oldFile#">
|
||||||
|
|
@ -70,7 +70,7 @@ if (bizId LTE 0) {
|
||||||
<!--- Update database --->
|
<!--- Update database --->
|
||||||
<cfquery datasource="payfrit">
|
<cfquery datasource="payfrit">
|
||||||
UPDATE Businesses
|
UPDATE Businesses
|
||||||
SET HeaderImageExtension = <cfqueryparam cfsqltype="cf_sql_varchar" value="#uploadResult.ClientFileExt#">
|
SET BusinessHeaderImageExtension = <cfqueryparam cfsqltype="cf_sql_varchar" value="#uploadResult.ClientFileExt#">
|
||||||
WHERE BusinessID = <cfqueryparam cfsqltype="cf_sql_integer" value="#bizId#">
|
WHERE BusinessID = <cfqueryparam cfsqltype="cf_sql_integer" value="#bizId#">
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue