Commit 94efb8d9 by 黄静

hj

parent 77f5a2e6
......@@ -25,16 +25,10 @@ class qualificationsDao:
return self.dataBase.sqlResult(
'SELECT industry_two_code,industry_two FROM ent_qualification WHERE industry_one_code = "%s" GROUP BY industry_two ORDER BY id' % industry_one_code)
def selectQualifications(self,platform_code,export_label, store_type_code, industry_one_code, industry_two_code):
if industry_one_code in (25, 28, 36, 37) or industry_two_code in (
2716, 3041, 3042, 3043, 3044, 3045, 3258, 3476):
return self.dataBase.sqlResult(
"SELECT * FROM `ent_qualification` WHERE platform_code = '%s' and store_type_code = '%s' and industry_one_code = '%s' and industry_two_code = '%s' AND enter_label != '0'" % (
platform_code,store_type_code, industry_one_code, industry_two_code))
else:
return self.dataBase.sqlResult(
"SELECT * FROM `ent_qualification` WHERE platform_code = '%s' and export_label = '%s' AND store_type_code = '%s' and industry_one_code = '%s' and industry_two_code = '%s' AND enter_label != '0'" % (
platform_code,export_label, store_type_code, industry_one_code, industry_two_code))
def selectQualifications(self,platform_code,export_label, store_type_code, industry_one_code, industry_two_code_list):
return self.dataBase.sqlResult(
"SELECT * FROM `ent_qualification` WHERE platform_code = '%s' and export_label in %s AND store_type_code = '%s' and industry_one_code = '%s' and industry_two_code in (%s) AND enter_label != '0'" % (
platform_code,export_label, store_type_code, industry_one_code, to_sql_in(industry_two_code_list)))
def selectQualificationsUse(self, platform_code,export_label, store_type_code, industry_one_code, industry_two_code):
print( "SELECT * FROM `ent_qualification` WHERE export_label in %s AND store_type_code = '%s' and industry_one_code = '%s' and platform_code = '%s' and industry_two_code in (%s) and industry_label = 1" % (
......
......@@ -47,4 +47,4 @@ def RecommendationBusinessMain():
return {"status": -1, "msg": "failed", "data": str(error)}
if __name__ == '__main__':
server.run(debug=True,host='0.0.0.0',port=8090)
\ No newline at end of file
server.run(debug=True,host='0.0.0.0',port=80)
\ No newline at end of file
......@@ -10,7 +10,7 @@ from flask import request
qualifications_info = qualificationsDao()
#根据信息查询资质信息
def qualificationsInfo(platform_code,export_label, store_type_code, industry_one_code,industry_two_code):
def qualificationsInfo(platform_code,export_label, store_type_code, industry_one_code,industry_two_code_list):
data_dict = {}
base_list = []
brand_list = []
......@@ -20,7 +20,7 @@ def qualificationsInfo(platform_code,export_label, store_type_code, industry_one
brand_alone = []
industry_alone = []
qualifications_result = qualifications_info.selectQualifications(platform_code,export_label, store_type_code, industry_one_code,industry_two_code)
qualifications_result = qualifications_info.selectQualifications(platform_code,export_label, store_type_code, industry_one_code,industry_two_code_list)
print('qualifications_result',qualifications_result)
if qualifications_result:
for row in qualifications_result:
......@@ -85,19 +85,21 @@ def qualificationsRoute(server):
request_data = request.json
isImports = request_data['isImports']
if isImports == False:
export_label = '0'
export_label = (0,3)
else:
export_label = '1'
export_label = (1,3)
platform_code = request_data['platformCode']
store_type_code = request_data['storeTypeId']
industry_one_code = request_data['industryId']
secondIndustry = request_data['secondIndustry']
industry_two_code_list = []
for item in secondIndustry:
if item['isChoice'] == True:
industry_two_code = int(item['id'])
industry_two_code_list.append(industry_two_code)
print('传入参数:',request_data)
print('查询条件',platform_code,export_label, store_type_code, industry_one_code,industry_two_code)
data_dict = qualificationsInfo(platform_code,export_label, store_type_code, industry_one_code,industry_two_code)
data_dict = qualificationsInfo(platform_code,export_label, store_type_code, industry_one_code,industry_two_code_list)
result_dict['data'] = data_dict
result_dict['status'] = 0
result_dict['msg'] = "success"
......
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