修复:seek/match API同时支持information和seek_info表查询
This commit is contained in:
parent
7d0f92b1eb
commit
eea94ec381
|
|
@ -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="寻配号信息不存在")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue