修复:seek/match API同时支持information和seek_info表查询

This commit is contained in:
甲辰生产 2026-04-24 10:46:36 +08:00
parent 7d0f92b1eb
commit eea94ec381
1 changed files with 6 additions and 0 deletions

View File

@ -646,11 +646,17 @@ def get_seek_match(
if not current_user:
raise HTTPException(status_code=401, detail="请先登录")
# 先查 information 表
info = db.query(Information).filter(
Information.id == info_id,
Information.info_type == "seek"
).first()
# 如果 information 表没有,尝试 seek_info 表
if not info:
from app.models.seek import SeekInfo
info = db.query(SeekInfo).filter(SeekInfo.id == info_id).first()
if not info:
raise HTTPException(status_code=404, detail="寻配号信息不存在")