Refactor getData function and fix query bug
This commit is contained in:
@@ -49,9 +49,9 @@ def loginDB():
|
||||
)
|
||||
return mydb
|
||||
|
||||
def getData(node, dataType, MAC, dateStart, dateEnd):
|
||||
def getData(node, dataType, MAC, dateStart, dateEnd, type):
|
||||
mydb = loginDB()
|
||||
query = get_query(node, dataType, MAC, False, False, dateStart, dateEnd)
|
||||
query = get_query(node, dataType, MAC, dateStart, dateEnd, type)
|
||||
cursor = mydb.cursor(dictionary=True) # Enable dictionary output
|
||||
cursor.execute(query)
|
||||
result = cursor.fetchall() # Fetch the results
|
||||
|
Reference in New Issue
Block a user