WIP: Started to add more stats to the product stats page.

This commit is contained in:
2024-02-09 18:45:33 +00:00
parent c55fdde3fc
commit 7c27aa31b6
4 changed files with 58 additions and 6 deletions

View File

@@ -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")