Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
order by likes and last modified
Browse files
app.py
CHANGED
@@ -190,7 +190,7 @@ def get_page(page: int = 1):
|
|
190 |
SELECT *, COUNT(*) OVER() AS total
|
191 |
FROM models
|
192 |
WHERE json_extract(data, '$.likes') > 5
|
193 |
-
ORDER BY datetime(json_extract(data, '$.lastModified')) DESC
|
194 |
LIMIT ? OFFSET ?
|
195 |
""", (MAX_PAGE_SIZE, (page - 1) * MAX_PAGE_SIZE))
|
196 |
results = cursor.fetchall()
|
|
|
190 |
SELECT *, COUNT(*) OVER() AS total
|
191 |
FROM models
|
192 |
WHERE json_extract(data, '$.likes') > 5
|
193 |
+
ORDER BY json_extract(data, '$.likes') DESC, datetime(json_extract(data, '$.lastModified')) DESC
|
194 |
LIMIT ? OFFSET ?
|
195 |
""", (MAX_PAGE_SIZE, (page - 1) * MAX_PAGE_SIZE))
|
196 |
results = cursor.fetchall()
|