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}$',