This commit is contained in:
yumoqing 2026-06-26 14:00:55 +08:00
parent 339fccf6d2
commit e998e2a4b2

View File

@ -8,14 +8,14 @@ try:
org_id = (await get_userorgid()) or '0'
dbname = get_module_dbname('product_management')
sql = """SELECT id, name FROM product_category
sql = """SELECT id as category_id, name as category_id_text FROM product_category
WHERE has_product='1' AND status='1' AND org_id = ${org_id}$
ORDER BY sort_order ASC, name ASC"""
async with DBPools().sqlorContext(dbname) as sor:
rows = await sor.sqlExe(sql, {'org_id': org_id})
if rows:
result['data'] = [{'value': str(r['id']), 'text': r['name']} for r in rows]
result['data'] = rows
result['success'] = True
except Exception as e: