From 3159afbedefdd676e8a53130e34e03a0d34857de Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 12 Jul 2026 09:37:38 +0800 Subject: [PATCH] fix: get_search_prodtypeid/productid query correct DB (sage) and tables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - prodtypeid: product_types→product_category, supplychain→sage - productid: products→product, supplychain→sage --- wwwroot/api/get_search_prodtypeid.dspy | 6 ++---- wwwroot/api/get_search_productid.dspy | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) 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)