Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
miladbarooni committed Jan 24, 2020
2 parents 17cdcb8 + 4beaf5f commit 4d5f8db
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions snapFood.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ def deletAddress(self, address_id):

def updateAddress(self, x = None, y = None, city_id = None, street = None, alley = None, plaque = None, address_text = None):
data = self.showAddress(address_id)
if x == None:
return

#if x == None:
#if x == None:
#if x == None:
#if x == None:
#if x == None:
#if x == None:

def searchShopByLocation(self, address_id, radius):
self._mycursor.execute("SELECT * FROM LOCATION WHERE ADDRESSaddressid = \'{}\';".format(address_id))
Expand Down Expand Up @@ -198,8 +201,8 @@ def showBuyHistory(self, user_id): #NOT CHECKED
"""
self._mycursor.execute("""SELECT invoiceid, `total-price`, DISCOUNT.text, ADDRESSaddressid, FOODfoodid, COMMENT.commentid, STATUS.name FROM
((((((INVOIC JOIN DISCOUNT ON DISCOUNTdiscountid = discountid)
JOIN COMMENT ON COMMENTcomentid = commentid)
JOIN (FOOD_INVOIC ON INVOICinvoicid = invoiceid) JOIN FOOD ON FOODfoodid = foodid)
JOIN COMMENT ON COMMENTcommentid = commentid)
JOIN (FOOD_INVOIC JOIN FOOD ON FOODfoodid = foodid) ON INVOICinvoiceid = invoiceid)
JOIN STATUS ON STATUSstatusid = statusid)
JOIN ADDRESS ON ADDRESSaddressid = addressid)
JOIN WALLET ON WALLETwalletid = walletid)
Expand Down Expand Up @@ -346,3 +349,7 @@ def temp(self):

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

db = SnapFoodDB()
print(db.showBuyHistory(4))
db.close()

0 comments on commit 4d5f8db

Please sign in to comment.