fix: 恢复org_id限制,添加debug日志排查问题
This commit is contained in:
parent
01a4dddc59
commit
79756800d7
@ -29,13 +29,16 @@ FROM {product_management}.product p
|
|||||||
LEFT JOIN {product_management}.product_category pc ON p.category_id = pc.id
|
LEFT JOIN {product_management}.product_category pc ON p.category_id = pc.id
|
||||||
LEFT JOIN discount_detail dd ON dd.productid = p.id
|
LEFT JOIN discount_detail dd ON dd.productid = p.id
|
||||||
AND dd.discountid = ${discountid}$
|
AND dd.discountid = ${discountid}$
|
||||||
WHERE p.status = '1'
|
WHERE p.org_id = ${org_id}$ AND p.status = '1'
|
||||||
ORDER BY pc.name, p.product_name
|
ORDER BY pc.name, p.product_name
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
ns['org_id'] = user_orgid
|
||||||
|
|
||||||
db = DBPools()
|
db = DBPools()
|
||||||
dbname = get_module_dbname('discount')
|
dbname = get_module_dbname('discount')
|
||||||
|
debug(f'get_products_with_discount: org_id={user_orgid}, discountid={discountid}, dbname={dbname}')
|
||||||
async with db.sqlorContext(dbname) as sor:
|
async with db.sqlorContext(dbname) as sor:
|
||||||
r = await sor.sqlPaging(sql, ns)
|
r = await sor.sqlPaging(sql, ns)
|
||||||
debug(f'get_products_with_discount: {len(r.get("rows", []))} products for org {user_orgid}')
|
debug(f'get_products_with_discount: returned {len(r.get("rows", []))} products')
|
||||||
return r
|
return r
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user