bugfix
This commit is contained in:
parent
49daa9815d
commit
7e247f308e
8
platformbiz/getdbname.py
Normal file
8
platformbiz/getdbname.py
Normal 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')
|
||||||
|
|
@ -6,15 +6,15 @@ from sqlor.dbpools import DBPools
|
|||||||
from ahserver.serverenv import get_serverenv
|
from ahserver.serverenv import get_serverenv
|
||||||
from accounting.accounting_config import Accounting
|
from accounting.accounting_config import Accounting
|
||||||
from accounting.bizaccount import BizAccounting
|
from accounting.bizaccount import BizAccounting
|
||||||
|
|
||||||
from accounting.bill import write_bill
|
from accounting.bill import write_bill
|
||||||
|
from getdbname import get_dbname
|
||||||
|
|
||||||
async def get_owner_orgid(sor, orgid):
|
async def get_owner_orgid(sor, orgid):
|
||||||
return '0'
|
return '0'
|
||||||
|
|
||||||
async def get_balance(orgid):
|
async def get_balance(orgid):
|
||||||
db = DBPools()
|
db = DBPools()
|
||||||
dbname = await rfexe('get_module_dbname', 'platformbiz')
|
dbname = get_dbname()
|
||||||
async with db.sqlorContext(dbname) as sor:
|
async with db.sqlorContext(dbname) as sor:
|
||||||
f = get_serverenv('getCustomerBalance')
|
f = get_serverenv('getCustomerBalance')
|
||||||
if f:
|
if f:
|
||||||
|
@ -3,6 +3,7 @@ from appPublic.registerfunction import rfexe
|
|||||||
from appPublic.log import exception, debug
|
from appPublic.log import exception, debug
|
||||||
from sqlor.dbpools import DBPools
|
from sqlor.dbpools import DBPools
|
||||||
from pf_pay.ali_pay import Zhifubao_Pay
|
from pf_pay.ali_pay import Zhifubao_Pay
|
||||||
|
from getdbname import get_dbname
|
||||||
from platformbiz.biz_order import add_recharge_log, add_recharge_order
|
from platformbiz.biz_order import add_recharge_log, add_recharge_order
|
||||||
|
|
||||||
class Recharge:
|
class Recharge:
|
||||||
@ -23,7 +24,7 @@ class Recharge:
|
|||||||
|
|
||||||
async def start_recharge_action(self, action):
|
async def start_recharge_action(self, action):
|
||||||
db = DBPools()
|
db = DBPools()
|
||||||
dbname = await rfexe('get_module_dbname', 'platformbiz')
|
dbname = get_dbname()
|
||||||
async with db.sqlorContext(dbname) as sor:
|
async with db.sqlorContext(dbname) as sor:
|
||||||
order = await add_recharge_order(sor, self.customerid,
|
order = await add_recharge_order(sor, self.customerid,
|
||||||
self.userid,
|
self.userid,
|
||||||
|
Loading…
Reference in New Issue
Block a user