25 lines
833 B
Plaintext
25 lines
833 B
Plaintext
async def computing_voucher_update(ns={}):
|
|
db = DBPools()
|
|
async with db.sqlorContext('kboss') as sor:
|
|
try:
|
|
voucher_dict = ns
|
|
if ns.get('denomination'):
|
|
voucher_dict['denomination'] = float(ns.get('denomination'))
|
|
if ns.get('balance'):
|
|
voucher_dict['balance'] = float(ns.get('balance'))
|
|
await sor.U("computing_voucher", voucher_dict)
|
|
return {
|
|
"status": True,
|
|
"msg": "算力券更新成功"
|
|
}
|
|
except Exception as e:
|
|
sor.rollback()
|
|
return {
|
|
"status": False,
|
|
"msg": "算力券更新有误",
|
|
"error": str(e)
|
|
}
|
|
|
|
ret = await computing_voucher_update(params_kw)
|
|
return ret
|
|
|