This commit is contained in:
yumoqing 2026-03-30 11:38:05 +08:00
parent 749ff10d33
commit 13d6d33203

View File

@ -51,6 +51,7 @@ async def checkCustomerBalance(llmid, userorgid):
async def llm_accounting(request, llmusage): async def llm_accounting(request, llmusage):
env = request._run_ns env = request._run_ns
llmid = llmusage.llmid
async with get_sor_context(request._run_ns, 'llmage') as sor: async with get_sor_context(request._run_ns, 'llmage') as sor:
sql = "select * from llm where id=${llmid}$" sql = "select * from llm where id=${llmid}$"
recs = await sor.sqlExe(sql, {'llmid': llmusage.llmid}) recs = await sor.sqlExe(sql, {'llmid': llmusage.llmid})
@ -63,6 +64,7 @@ async def llm_accounting(request, llmusage):
exception(f'{e}') exception(f'{e}')
raise e raise e
customerid = llmusage.userorgid customerid = llmusage.userorgid
userid = llmusage.userid
resellerid = recs[0].ownerid resellerid = recs[0].ownerid
providerid = recs[0].providerid providerid = recs[0].providerid
trans_amount = llmusage.amount trans_amount = llmusage.amount