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:
parent
0049db58e5
commit
3159afbede
@ -1,10 +1,8 @@
|
|||||||
result = [{'prodtypeid': '', 'prodtypeid_text': '全部'}]
|
result = [{'prodtypeid': '', 'prodtypeid_text': '全部'}]
|
||||||
try:
|
try:
|
||||||
db = DBPools()
|
async with DBPools().sqlorContext('sage') as sor:
|
||||||
dbname = get_module_dbname('supplychain')
|
|
||||||
async with db.sqlorContext(dbname) as sor:
|
|
||||||
rows = await sor.sqlExe(
|
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)
|
return json.dumps(result + list(rows), ensure_ascii=False)
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
result = [{'productid': '', 'productid_text': '全部'}]
|
result = [{'productid': '', 'productid_text': '全部'}]
|
||||||
try:
|
try:
|
||||||
db = DBPools()
|
async with DBPools().sqlorContext('sage') as sor:
|
||||||
dbname = get_module_dbname('supplychain')
|
|
||||||
async with db.sqlorContext(dbname) as sor:
|
|
||||||
rows = await sor.sqlExe(
|
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)
|
return json.dumps(result + list(rows), ensure_ascii=False)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user