From f6c29c8c38de52c7c978d08d2b4341e9f964d263 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 14 Jul 2026 10:44:23 +0800 Subject: [PATCH] fix: use get_module_dbname for discount db in init_free_customers --- wwwroot/api/init_free_customers.dspy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wwwroot/api/init_free_customers.dspy b/wwwroot/api/init_free_customers.dspy index 279fc91..6290edf 100644 --- a/wwwroot/api/init_free_customers.dspy +++ b/wwwroot/api/init_free_customers.dspy @@ -5,6 +5,7 @@ if not userorgid: return {'widgettype': 'Error', 'options': {'title': 'Error', 'message': '请先登录', 'timeout': 3}} count = 0 +disc_dbname = get_module_dbname('discount') async with DBPools().sqlorContext('sage') as sor: # Get all users (filtered by org if not owner) if userorgid == '0': @@ -17,7 +18,7 @@ async with DBPools().sqlorContext('sage') as sor: if not users: return {'widgettype': 'Message', 'options': {'title': '提示', 'message': '该机构下无用户', 'type': 'warning', 'timeout': 3}} - async with DBPools().sqlorContext('discount') as disc_sor: + async with DBPools().sqlorContext(disc_dbname) as disc_sor: for u in users: existing = await disc_sor.sqlExe( 'SELECT id FROM discount_customer_bind WHERE customerid = ${cid}$',