fix: use m.apiname from llm_api_map instead of a.apiname (column not in llm table)

This commit is contained in:
yumoqing 2026-06-11 17:44:11 +08:00
parent 3947fb3587
commit 0f2d84bd00
3 changed files with 7 additions and 4 deletions

View File

@ -45,8 +45,9 @@ if action == 'check':
recs = await sor.sqlExe(""" recs = await sor.sqlExe("""
select a.*, e.ioid, e.stream select a.*, e.ioid, e.stream
from llm a from llm a
join llm_api_map m on a.id = m.llmid
join upapp c on a.upappid = c.id join upapp c on a.upappid = c.id
join uapi e on c.id = e.upappid and a.apiname = e.name join uapi e on c.id = e.upappid and m.apiname = e.name
where a.id=${llmid}$""", {'llmid': llmid}) where a.id=${llmid}$""", {'llmid': llmid})
if recs: if recs:
await add_check('API映射(uapi)', True, f'ioid={recs[0].ioid}, stream={recs[0].stream}') await add_check('API映射(uapi)', True, f'ioid={recs[0].ioid}, stream={recs[0].stream}')

View File

@ -17,7 +17,7 @@ from llm a
join llm_api_map m on a.id = m.llmid join llm_api_map m on a.id = m.llmid
join llmcatelog b on m.llmcatelogid = b.id join llmcatelog b on m.llmcatelogid = b.id
join upapp c on a.upappid = c.id join upapp c on a.upappid = c.id
join uapi e on c.id = e.upappid and a.apiname = e.name join uapi e on c.id = e.upappid and m.apiname = e.name
where a.status = 'published' where a.status = 'published'
) x left join historyformat y on x.hfid = y.id ) x left join historyformat y on x.hfid = y.id
left join uapiio z on x.ioid = z.id left join uapiio z on x.ioid = z.id

View File

@ -24,8 +24,9 @@ where a.id=${llmid}$
sql = """select a.*, e.ioid, e.stream sql = """select a.*, e.ioid, e.stream
from llm a from llm a
join llm_api_map m on a.id = m.llmid
join upapp c on a.upappid = c.id join upapp c on a.upappid = c.id
join uapi e on c.id = e.upappid and a.apiname = e.name join uapi e on c.id = e.upappid and m.apiname = e.name
where a.id=${llmid}$ where a.id=${llmid}$
and a.expired_date > ${today}$ and a.expired_date > ${today}$
and a.enabled_date <= ${today}$""" and a.enabled_date <= ${today}$"""
@ -38,8 +39,9 @@ where a.id=${llmid}$
sql = """select a.*, e.ioid, e.stream sql = """select a.*, e.ioid, e.stream
from llm a from llm a
join llm_api_map m on a.id = m.llmid
join upapp c on a.upappid = c.id join upapp c on a.upappid = c.id
join uapi e on c.id = e.upappid and a.apiname = e.name join uapi e on c.id = e.upappid and m.apiname = e.name
join uapiio b on e.ioid = b.id join uapiio b on e.ioid = b.id
where a.id=${llmid}$ where a.id=${llmid}$
and a.expired_date > ${today}$ and a.expired_date > ${today}$