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 --->
|
||||
<cfquery name="qOldHeader" datasource="payfrit">
|
||||
SELECT HeaderImageExtension
|
||||
SELECT BusinessHeaderImageExtension
|
||||
FROM Businesses
|
||||
WHERE ID = <cfqueryparam cfsqltype="cf_sql_integer" value="#bizId#">
|
||||
WHERE BusinessID = <cfqueryparam cfsqltype="cf_sql_integer" value="#bizId#">
|
||||
</cfquery>
|
||||
|
||||
<cfif qOldHeader.recordCount GT 0 AND len(trim(qOldHeader.HeaderImageExtension)) GT 0>
|
||||
<cfset oldFile = "#headersDir#/#bizId#.#qOldHeader.HeaderImageExtension#">
|
||||
<cfif qOldHeader.recordCount GT 0 AND len(trim(qOldHeader.BusinessHeaderImageExtension)) GT 0>
|
||||
<cfset oldFile = "#headersDir#/#bizId#.#qOldHeader.BusinessHeaderImageExtension#">
|
||||
<cfif fileExists(oldFile)>
|
||||
<cftry>
|
||||
<cffile action="DELETE" file="#oldFile#">
|
||||
|
|
@ -70,7 +70,7 @@ if (bizId LTE 0) {
|
|||
<!--- Update database --->
|
||||
<cfquery datasource="payfrit">
|
||||
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#">
|
||||
</cfquery>
|
||||
|
||||
|
|
|
|||
Reference in a new issue