fix: get_search_prodtypeid/productid query correct DB (sage) and tables

- prodtypeid: product_types→product_category, supplychain→sage
- productid: products→product, supplychain→sage
This commit is contained in:
yumoqing 2026-07-12 09:37:38 +08:00
parent 0049db58e5
commit 3159afbede
2 changed files with 4 additions and 8 deletions

View File

@ -1,10 +1,8 @@
result = [{'prodtypeid': '', 'prodtypeid_text': '全部'}]
try:
db = DBPools()
dbname = get_module_dbname('supplychain')
async with db.sqlorContext(dbname) as sor:
async with DBPools().sqlorContext('sage') as sor:
rows = await sor.sqlExe(
"select id as prodtypeid, type_name as prodtypeid_text from product_types order by type_name",
"select id as prodtypeid, name as prodtypeid_text from product_category where status='1' order by sort_order, name",
{}
)
return json.dumps(result + list(rows), ensure_ascii=False)

View File

@ -1,10 +1,8 @@
result = [{'productid': '', 'productid_text': '全部'}]
try:
db = DBPools()
dbname = get_module_dbname('supplychain')
async with db.sqlorContext(dbname) as sor:
async with DBPools().sqlorContext('sage') as sor:
rows = await sor.sqlExe(
"select id as productid, product_name as productid_text from products order by product_name",
"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)