kboss/b/lease/get_bill_detail.dspy
2025-07-16 14:27:17 +08:00

33 lines
792 B
Plaintext

def check_lease_data(ns={}):
check_key = [
"bill_id",
]
for k in check_key:
if not ns.get(k, None):
return f"get key is null, please check key:{k}"
else:
if len(ns[k]) == 0:
return f"the args len is 0, please check key:{k}"
return ""
async def get_bill_detail(ns={}):
"""
获取账单详情
:param ns:
:return:
"""
f = check_lease_data(ns)
if f:
return {"status": False, "msg": f}
db = DBPools()
async with db.sqlorContext('kboss') as sor:
sql = "SELECT * FROM lease_bill_data WHERE del_flg = 0 and bill_id = ${bill_id}$"
data = await sor.sqlExe(sql, ns)
return {"status": True, "data": data}
ret = await get_bill_detail(params_kw)
return ret