diff --git a/discount/init.py b/discount/init.py index 3800537..19aa2a2 100644 --- a/discount/init.py +++ b/discount/init.py @@ -805,10 +805,10 @@ async def get_discount_info(request): config = getConfig() db.databases = config.databases sql = """ - SELECT d.name, o.orgname - FROM discount d - LEFT JOIN organization o ON d.customerid = o.id - WHERE d.id = ${discountid}$ + SELECT dm.name, o.orgname + FROM discount_marketing dm + LEFT JOIN organization o ON dm.resellerid = o.id + WHERE dm.id = ${discountid}$ """ async with db.sqlorContext(dbname) as sor: recs = await sor.sqlExe(sql, {'discountid': discountid})