训练图片管理面板,右侧统计从前十限制改为全部,并且支持点击直接显示。
This commit is contained in:
@@ -270,7 +270,7 @@ class MySQLManager:
|
||||
month_start = today_start.replace(day=1)
|
||||
month_count = base_query.filter(Model.create_time >= month_start).count()
|
||||
|
||||
# TOP 10物品统计
|
||||
# 全部物品统计(按数量降序)
|
||||
from sqlalchemy import func
|
||||
top_items = session.query(
|
||||
Model.goods_name,
|
||||
@@ -289,7 +289,6 @@ class MySQLManager:
|
||||
|
||||
top_items = top_items.group_by(Model.goods_name)\
|
||||
.order_by(func.count(Model.id).desc())\
|
||||
.limit(10)\
|
||||
.all()
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user