diff --git a/b/cntoai/process_user_billing.dspy b/b/cntoai/process_user_billing.dspy index 2dc2e17..dc8c87a 100644 --- a/b/cntoai/process_user_billing.dspy +++ b/b/cntoai/process_user_billing.dspy @@ -260,6 +260,13 @@ async def process_user_billing(ns={}): 'status': 'error', 'msg': 'llmid必传' } + model_name = ns.get('model') + if not model_name: + debug(f"{userid} process_user_billing model必传") + return { + 'status': 'error', + 'msg': 'model必传' + } try: amount = round(float(amount), 12) @@ -275,6 +282,9 @@ async def process_user_billing(ns={}): async with db.sqlorContext('kboss') as sor: try: product_li = await sor.R('product', {'providerpid': llmid, 'del_flg': '0'}) + if not product_li: + product_li = await sor.R('product', {'product_code': model_name, 'del_flg': '0'}) + if not product_li: debug(f"{userid} process_user_billing 未找到对应产品,请确认") return {