Commit be45ae77 authored by rico.liu's avatar rico.liu

add element

parent 19b76148
......@@ -34,6 +34,25 @@ def get_category_params_list(category_name):
return params_list
def get_configure_price():
#获取配件价格
try:
conn = pymssql.connect(host='123.56.115.207', user='zgcindex', password='jiayou202006', database='ZI_NEW',autocommit=True)
cursor = conn.cursor()
#cursor.execute("select * from vw_electricity_source_price where ProductCode in "+ code_list +" and periods = (select top 1 periods from vw_entry_source_price order by periods desc)")
cursor.execute("select category_code,category_name,part,detail,price from configure_price")
configure_price = pd.DataFrame([v for v in cursor.fetchall()],columns=[tuple[0] for tuple in cursor.description])
configure_price['price'] = pd.to_numeric(configure_price['price'])
cursor.close()
conn.close()
return configure_price
except:
print('连接失败,重新连接')
return get_configure_price()
def check_configure_price(category,path):
if category not in ['笔记本','台式机','一体电脑','工作站']:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment