diff --git a/wwwroot/api/get_search_prodtypeid.dspy b/wwwroot/api/get_search_prodtypeid.dspy index ae90511..91b62a9 100644 --- a/wwwroot/api/get_search_prodtypeid.dspy +++ b/wwwroot/api/get_search_prodtypeid.dspy @@ -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) diff --git a/wwwroot/api/get_search_productid.dspy b/wwwroot/api/get_search_productid.dspy index de949fa..07d4421 100644 --- a/wwwroot/api/get_search_productid.dspy +++ b/wwwroot/api/get_search_productid.dspy @@ -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)