async def providerDiscountOldSearch(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": "provider discount search success", "data": res_li } except Exception as e: raise e return { "status": False, "msg": "provider discount search failed" } ret = await providerDiscountOldSearch(params_kw) return ret