Commit 77f5a2e6 by xuxu

修复二级行业多选问题

parent e5a86be6
......@@ -6,6 +6,8 @@
# createTime:2020/7/19 13:15
from db.mod_db import Database
from common.sql_utils import to_sql_in
class qualificationsDao:
......@@ -35,7 +37,9 @@ class qualificationsDao:
platform_code,export_label, store_type_code, industry_one_code, industry_two_code))
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" % (
export_label, store_type_code, industry_one_code,platform_code, to_sql_in(industry_two_code)))
return self.dataBase.sqlResult(
"SELECT * FROM `ent_qualification` WHERE export_label = '%s' AND store_type_code = '%s' and industry_one_code = '%s' and platform_code = '%s' and industry_two_code = '%s' and industry_label = 1" % (
export_label, store_type_code, industry_one_code,platform_code, industry_two_code))
"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" % (
export_label, store_type_code, industry_one_code,platform_code, to_sql_in(industry_two_code)))
......@@ -11,7 +11,7 @@ class qualificationsProductDao:
def get_recommend(self,product_list):
print("select * from ent_recommend_product join ent_product_comments on "
"ent_recommend_product.recommendation_business_code = ent_product_comments.product_name where qualification_comments in (%s)" % to_sql_in(product_list))
return self.dataBase.sqlResult("select * from ent_recommend_product join ent_product_comments on "
return self.dataBase.sqlResult("select * from ent_recommend_product left join ent_product_comments on "
"ent_recommend_product.recommendation_business = ent_product_comments.product_name where qualification_comments in (%s)" % to_sql_in(product_list))
def random_recommend(self):
......
......@@ -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=80)
\ No newline at end of file
server.run(debug=True,host='0.0.0.0',port=8090)
\ No newline at end of file
......@@ -6,21 +6,23 @@ qualificationsproductdao = qualificationsProductDao()
def recommend_function(select_data):
isImports = select_data['isImports']
if isImports:
isImports = 1
isImports = (1,3)
if not isImports:
isImports = 0
isImports = (0,3)
storeTypeId = select_data['storeTypeId']
industryId = select_data['industryId']
secondIndustry = []
for item in select_data['secondIndustry']:
if item['isChoice'] == True:
secondIndustry = item['id']
secondIndustry.append(item['id'])
platform_code = select_data['platformCode']
#办理资质必须的业务员
qualifications = qualificationsdao.selectQualificationsUse(platform_code,isImports,storeTypeId,industryId,secondIndustry)
must_use = []
for item in qualifications:
must_use.append(item['qualification_comments'])
if item['qualification_comments'] not in must_use:
must_use.append(item['qualification_comments'])
print("用户必选=============",must_use)
......
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