feat(huya): 协作台账支持皮肤筛选与主页截图拖拽/粘贴上传

- 外部单列表新增礼包/皮肤精确筛选,并提供去重下拉选项
- 主页截图支持拖拽、多选及 Ctrl/Cmd+V 剪贴板粘贴上传
This commit is contained in:
yml2213
2026-10-17 12:49:42 +08:00
parent 1dd5c4a279
commit 26b8d6b054
8 changed files with 173 additions and 29 deletions
@@ -2019,6 +2019,14 @@ def list_shops(db: Session) -> list[str]:
return sorted(shop.name for shop in list_shop_records(db))
def list_gift_names(db: Session) -> list[str]:
"""台账里出现过的礼包/皮肤名(去重、去空;筛选下拉用)。"""
rows = db.query(HuyaExternalOrder.gift_name).distinct().all()
return sorted(
{str(row[0]).strip() for row in rows if row[0] and str(row[0]).strip()}
)
# --------------------------------------------------------------------------
# CRUD
# --------------------------------------------------------------------------
@@ -2262,6 +2270,7 @@ def list_orders(
owner_id: int | None = None,
status: str = "",
ck_status: str = "",
gift_name: str = "",
keyword: str = "",
include_void: bool = False,
page: int = 1,
@@ -2277,6 +2286,9 @@ def list_orders(
query = query.filter(HuyaExternalOrder.status == status)
if ck_status:
query = query.filter(HuyaExternalOrder.ck_status == ck_status)
skin = (gift_name or "").strip()
if skin:
query = query.filter(HuyaExternalOrder.gift_name == skin)
if not include_void:
query = query.filter(HuyaExternalOrder.status != STATUS_VOID)
text = (keyword or "").strip()