Skip to content

Instantly share code, notes, and snippets.

@davidsf
Created July 20, 2012 15:55
Show Gist options
  • Save davidsf/3151522 to your computer and use it in GitHub Desktop.
Save davidsf/3151522 to your computer and use it in GitHub Desktop.
<cfquery name="en_memoria" datasource="venvir">
SELECT * FROM Memoria WHERE Id_Lote = #datos_para_gateway.num_lote# AND URL_TOKEN = '#datos_para_gateway.usr_token#'
</cfquery>
<cfif #en_memoria.RecordCount# EQ 0>
<cfquery name="memoria" datasource="venvir">
INSERT INTO Memoria (Id_Lote, URL_Token, Fecha) VALUES (#datos_para_gateway.num_lote#, '#datos_para_gateway.usr_token#', #now()#);
</cfquery>
<cfelse>
<cfquery name="memoria" datasource="venvir">
UPDATE Memoria
SET Fecha = #now()#
WHERE Id_Lote = #datos_para_gateway.num_lote# AND URL_TOKEN = '#datos_para_gateway.usr_token#'
</cfquery>
</cfif>
<cfquery name="actualiza_ranking" datasource="venvir">
UPDATE Lotes SET Ranking = #datos_para_gateway.nvo_rank# WHERE Id_Lote = #datos_para_gateway.num_lote#
</cfquery>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment