fix: list_llms按catelogid排序-改SQL ORDER BY替代sort参数,修复同catelog被拆分成多组

This commit is contained in:
yumoqing 2026-07-21 10:52:05 +08:00
parent 112c86e80b
commit 6aa2f76c1e

View File

@ -362,10 +362,12 @@ m.ppid
and m.ppid is not null and m.ppid is not null
and a.expired_date > ${today}$ and a.expired_date > ${today}$
""" """
params = {'today': today, 'sort': ['catelog_id', 'providerid', 'name'] } params = {'today': today}
if catelogid: if catelogid:
sql += " and m.llmcatelogid = ${catelogid}$" sql += " and m.llmcatelogid = ${catelogid}$"
params['catelogid'] = catelogid params['catelogid'] = catelogid
sql += " order by m.llmcatelogid, a.providerid, a.name"
debug(f'{sql=}') debug(f'{sql=}')
recs = await sor.sqlExe(sql, params.copy()) recs = await sor.sqlExe(sql, params.copy())