This commit is contained in:
yumoqing 2025-04-12 19:48:51 +08:00
parent 49daa9815d
commit 7e247f308e
3 changed files with 12 additions and 3 deletions

8
platformbiz/getdbname.py Normal file
View File

@ -0,0 +1,8 @@
ifrom ahserver.serverenv import get_serverenv
def get_dbname():
f = get_serverenv('get_module_dbname')
if f is None:
raise Exception('get_module_dbname() not found')
return f('platformbiz')

View File

@ -6,15 +6,15 @@ from sqlor.dbpools import DBPools
from ahserver.serverenv import get_serverenv
from accounting.accounting_config import Accounting
from accounting.bizaccount import BizAccounting
from accounting.bill import write_bill
from getdbname import get_dbname
async def get_owner_orgid(sor, orgid):
return '0'
async def get_balance(orgid):
db = DBPools()
dbname = await rfexe('get_module_dbname', 'platformbiz')
dbname = get_dbname()
async with db.sqlorContext(dbname) as sor:
f = get_serverenv('getCustomerBalance')
if f:

View File

@ -3,6 +3,7 @@ from appPublic.registerfunction import rfexe
from appPublic.log import exception, debug
from sqlor.dbpools import DBPools
from pf_pay.ali_pay import Zhifubao_Pay
from getdbname import get_dbname
from platformbiz.biz_order import add_recharge_log, add_recharge_order
class Recharge:
@ -23,7 +24,7 @@ class Recharge:
async def start_recharge_action(self, action):
db = DBPools()
dbname = await rfexe('get_module_dbname', 'platformbiz')
dbname = get_dbname()
async with db.sqlorContext(dbname) as sor:
order = await add_recharge_order(sor, self.customerid,
self.userid,