sql="select region_name from lie_region where region_id in ("+str(province)+","+str(city)+","+str(district)+") "+"order by field ("+"region_id"+","+str(province)+","+str(city)+","+str(district)+") "
sql1="select region_name from lie_region where region_id = "+str(province)
sql2="select region_name from lie_region where region_id = "+str(city)
sql3="select region_name from lie_region where region_id = "+str(district)
user_detail_address=""
user_detail_address=""
cursor=db.cursor()
cursor=db.cursor()
cursor.execute(sql)
# 省
result=cursor.fetchall()
cursor.execute(sql1)
foriinrange(len(result)):
result1=cursor.fetchall()
iflen(result[i])==0:
foriinrange(len(result1)):
continue
iflen(result1[i])!=0:
user_detail_address+=result[i][0]
user_detail_address+=result1[i][0]
# 市
cursor.execute(sql2)
result2=cursor.fetchall()
foriinrange(len(result2)):
iflen(result2[i])!=0:
user_detail_address+=result2[i][0]
# 区
cursor.execute(sql3)
result3=cursor.fetchall()
foriinrange(len(result3)):
iflen(result3[i])!=0:
user_detail_address+=result3[i][0]
user_detail_address+=detail_address
user_detail_address+=detail_address
cursor.close()
cursor.close()
db.close()
db.cursor()
returnuser_detail_address
returnuser_detail_address
defpur():
defpur():
db=mysql.connector.connect(
db=mysql.connector.connect(
host="master.db2.liexindev.me",
host="master.db2.liexindev.me",
...
@@ -41,6 +61,7 @@ def pur():
...
@@ -41,6 +61,7 @@ def pur():
cursor=db.cursor()
cursor=db.cursor()
cursor.execute("select end_cust_cn, end_cust_en, create_uid, create_name, end_cust_id, com_addr from lie_end_cust_info")
cursor.execute("select end_cust_cn, end_cust_en, create_uid, create_name, end_cust_id, com_addr from lie_end_cust_info")
sql="select region_name from lie_region where region_id in "+"("+str(consignee_province)+","+str(consignee_city)+","+str(consignee_district)+") "+"order by field ("+"region_id"+","+str(consignee_province)+","+str(consignee_city)+","+str(consignee_district)+")"
cursor.execute(sql)
tax_address_result=cursor.fetchall()
foriinrange(len(tax_address_result)):
iflen(tax_address_result[i])==0:
continue
tax_detail_address+=tax_address_result[i][0]
tax_detail_address+=consignee_address
# 获取客户地址
# 获取客户地址
sql_user_address="select province, city, district, detail_address, address_type from lie_user_address where uc_id = "+str(uc_id)
sql_user_address="select province, city, district, detail_address, address_type from lie_user_address where uc_id = "+str(uc_id)