34 lines
840 B
Plaintext
34 lines
840 B
Plaintext
def check_lease_data(ns={}):
|
|
check_key = [
|
|
"user_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_list(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 WHERE del_flg = 0 and user_id = ${user_id}$"
|
|
ns["sort"] = ns.get("sort", "create_at desc")
|
|
data = await sor.sqlPaging(sql, ns)
|
|
return {"status": True, "data": data}
|
|
|
|
|
|
ret = await get_bill_list(params_kw)
|
|
return ret
|