WIP: Started to add more stats to the product stats page.
This commit is contained in:
@@ -76,6 +76,19 @@ class StatsController(DatabaseController):
|
||||
|
||||
return day_views
|
||||
|
||||
def read_product_views(self, id: int):
|
||||
""" Returns the total number of views for a product """
|
||||
params = [
|
||||
id
|
||||
]
|
||||
|
||||
# Total Views
|
||||
query = """
|
||||
SELECT count(id) FROM Views WHERE productID = ?
|
||||
"""
|
||||
|
||||
return self.get_one(query, params, int)
|
||||
|
||||
def update(self):
|
||||
print("Doing work")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user