|
@@ -93,9 +93,9 @@ class db():
|
|
|
lista_productos = [ (_id,p["id"],p["cantidad"]) for p in productos ]
|
|
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)
|
|
cur.executemany("insert into productos_pedido(id_pedido,id_producto,cantidad) values (%s, %s, %s)", lista_productos)
|
|
|
self.conn.commit()
|
|
self.conn.commit()
|
|
|
- return 0
|
|
|
|
|
|
|
|
|
|
def confirm(self, _hash, _id):
|
|
def confirm(self, _hash, _id):
|
|
|
c = self.client(_hash)
|
|
c = self.client(_hash)
|
|
|
cur = self.conn.cursor()
|
|
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()
|