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