fix: 添加images字段映射
This commit is contained in:
parent
79ce79b92c
commit
47e18948f1
|
|
@ -133,10 +133,6 @@ def get_collections(
|
|||
from sqlalchemy.orm import joinedload
|
||||
|
||||
# 管理员默认查看全库,普通用户只看自己
|
||||
if current_user is None:
|
||||
return {"error": "Unauthorized", "totalCount": 0}
|
||||
|
||||
# 获取所有藏品
|
||||
if current_user.role == "admin":
|
||||
# 联表查询获取用户名
|
||||
query = db.query(Collection, User.f01_01_name.label('owner_name')).join(
|
||||
|
|
@ -206,10 +202,6 @@ def get_collections(
|
|||
data_list = []
|
||||
for item in data:
|
||||
# 处理联表查询结果
|
||||
if current_user is None:
|
||||
return {"error": "Unauthorized", "totalCount": 0}
|
||||
|
||||
# 获取所有藏品
|
||||
if current_user.role == "admin":
|
||||
collection_item, owner_name = item
|
||||
else:
|
||||
|
|
@ -285,10 +277,6 @@ def get_stats(
|
|||
db: Session = Depends(get_db)
|
||||
):
|
||||
"""获取藏品统计"""
|
||||
# 获取所有藏品
|
||||
if current_user is None:
|
||||
return {"error": "Unauthorized", "totalCount": 0}
|
||||
|
||||
# 获取所有藏品
|
||||
if current_user.role == "admin":
|
||||
all_collections = db.query(Collection).all()
|
||||
|
|
|
|||
Loading…
Reference in New Issue