Sfoglia il codice sorgente

up0date date on confirm

David 9 anni fa
parent
commit
4e8832ee91
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      back/db.py

+ 2 - 2
back/db.py

@@ -93,9 +93,9 @@ class db():
 		lista_productos = [ (_id,p["id"],p["cantidad"]) for p in productos ]
 		cur.executemany("insert into productos_pedido(id_pedido,id_producto,cantidad) values (%s, %s, %s)", lista_productos)
 		self.conn.commit()
-		return 0
 	
 	def confirm(self, _hash, _id):
 		c = self.client(_hash)
 		cur = self.conn.cursor()
-		cur.execute("UPDATE pedidos set estado = 'CONFIRMADO' where id = %s and cliente = %s and estado = 'CREADO'", (_id,c["id"]))
+		cur.execute("UPDATE pedidos set estado = 'CONFIRMADO', fecha=NOW() where id = %s and cliente = %s and estado = 'CREADO'", (_id,c["id"]))
+		self.conn.commit()