supplychain/wwwroot/api/get_search_productid.dspy
yumoqing 3159afbede fix: get_search_prodtypeid/productid query correct DB (sage) and tables
- prodtypeid: product_types→product_category, supplychain→sage
- productid: products→product, supplychain→sage
2026-07-12 09:37:38 +08:00

12 lines
490 B
Plaintext

result = [{'productid': '', 'productid_text': '全部'}]
try:
async with DBPools().sqlorContext('sage') as sor:
rows = await sor.sqlExe(
"select id as productid, product_name as productid_text from product where status='1' order by sort_order, product_name",
{}
)
return json.dumps(result + list(rows), ensure_ascii=False)
except Exception as e:
debug(f'get_search_productid error: {e}')
return json.dumps(result, ensure_ascii=False)