Commit 5a2626a9 authored by 张彦钊's avatar 张彦钊

change test file

parent 191cd7d2
......@@ -76,8 +76,10 @@ def get_queues(device_id,city_id):
def tag_boost(cid_str, tag_list=[15,21,22,85,86]):
if cid_str is not None or cid_str != "":
cids = cid_str.split(",")
try:
if len(cids) > 6 and len(tag_list) > 0:
db = pymysql.connect(host='172.16.40.158', port=4000, user='root', passwd='3SYz54LS9#^9sBvC', db='eagle')
db = pymysql.connect(host='172.16.40.158', port=4000, user='root', passwd='3SYz54LS9#^9sBvC',
db='eagle')
sql = "select id,group_concat(diary_id) from " \
"(select a.diary_id,b.id from src_mimas_prod_api_diary_tags a left join src_zhengxing_api_tag b " \
......@@ -100,7 +102,7 @@ def tag_boost(cid_str, tag_list=[15,21,22,85,86]):
tag_list.append("right")
sort_cids = []
n = 0
while n != len(tag_cids)-1:
while n != len(tag_cids) - 1:
for i in tag_list:
if i in tag_cids.keys():
if len(tag_cids[i]) > 0:
......@@ -122,11 +124,13 @@ def tag_boost(cid_str, tag_list=[15,21,22,85,86]):
new_str = ",".join([str(i) for i in news_ids])
return new_str
else:
return cid_str
else:
return cid_str
except:
return cid_str
else:
return cid_str
......
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