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

38 lines
1.1 KiB
Plaintext

async def resellerDiscountOldSearch(ns={}):
"""
search reseller discount *为必填项
id *
:param ns:
:return:
"""
if not (ns.get('resellerid') and ns.get('productid')):
return {
"status": False,
"msg": "reseller discount failed, resellerid or productid is empty",
"data": ""
}
db = DBPools()
async with db.sqlorContext('kboss') as sor:
try:
ns['del_flg'] = 0
ns['sort'] = 'start_date'
res_li = await sor.R('rp_discount', ns)
if not res_li:
return {
"status": False,
"message": "can not find product in rp_discount table"
}
return {
"status": True,
"msg": "reseller discount search success",
"data": res_li
}
except Exception as e:
return {
"status": False,
"msg": "reseller discount search failed"
}
ret = await resellerDiscountOldSearch(params_kw)
return ret