Skip to content

Commit

Permalink
Waiting for history
Browse files Browse the repository at this point in the history
  • Loading branch information
miladbarooni committed Jan 23, 2020
1 parent c6df867 commit ee90ac6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,8 @@ def make_address_str(address_id):

def orderPage(self):
def showHistoryOfOrders():
print ("show history")
history_of_orders = mydb.showBuyHistory(self.user_id)
print (history_of_orders)
def finilizeCart(discount_code):
print (self.address_id)
mydb.finalizeCart(self.user_id, self.address_id, discount_code.get())
Expand Down
Binary file modified __pycache__/snapFood.cpython-37.pyc
Binary file not shown.
7 changes: 0 additions & 7 deletions snapFood.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,7 @@ def finalizeCart(self, user_id, address_id, discount_code = None): #NOT CHECKED
invoic_id = self._mycursor.lastrowid
total_price = 0
for food in foods:
<<<<<<< HEAD
self._mycursor.execute("INSERT INTO FOOD_INVOIC(FOODfoodid, INVOICinvoiceid) VALUES (\'{}\', \'{}\');"
=======
self._mycursor.execute("INSERT INTO FOOD_INVOIC (FOODfoodid, INVOICinvoiceid) VALUES (\'{}\', \'{}\');"
>>>>>>> bc279458a0ea8c7cacef0b0095a7b4fbacce9647
.format(food[0], invoic_id))
self._mycursor.execute("DELETE FROM CART WHERE USERuserid = \'{}\' AND FOODfoodid = \'{}\';".format(user_id,food[0]))
self._mycursor.execute("SELECT `minimum-bill-value`, price FROM SHOP JOIN FOOD ON shopid = SHOPshopid AND foodid = \'{}\'"
Expand Down Expand Up @@ -334,8 +330,6 @@ def addDiscountCodeForUser(self, user_id, code, percent=50):
self._mydb.commit()
return discount_id

<<<<<<< HEAD
=======
def temp(self):
return
#self._mycursor.execute("ALTER TABLE `FOOD_INVOIC` ADD `food-invoicid` int(11)")
Expand All @@ -344,6 +338,5 @@ def temp(self):
#self._mycursor.execute("ALTER TABLE FOOD_INVOIC ADD CONSTRAINT `is in` FOREIGN KEY (FOODfoodid) REFERENCES FOOD (foodid);")
#self._mycursor.execute("ALTER TABLE FOOD_INVOIC ADD CONSTRAINT `is in` FOREIGN KEY (INVOICinvoiceid) REFERENCES INVOIC (invoiceid);")

>>>>>>> bc279458a0ea8c7cacef0b0095a7b4fbacce9647
def close(self):
self._mydb.close()

0 comments on commit ee90ac6

Please sign in to comment.