Commit 38755886 authored by lixiaofang's avatar lixiaofang

add

parent 82ec9d3e
......@@ -85,17 +85,10 @@ def get_category_tag_id(edit_tag_list):
all_category_tag_list = CommunityCategoryTagRelation.objects.filter(tag_id__in=edit_tag_list, is_online=True,
is_deleted=False).values_list(
"category_tag_id", flat=True)
##去掉明星,品牌,其他的分类
category_tag = []
for i in all_category_tag_list:
if i not in [707000, 348494, 18344]:
category_tag.append(i)
# 随机拿一个
logging.info("get get_category_tag_id:%s" % category_tag)
if len(category_tag) > 0:
index = randint(0, len(category_tag) - 1)
return category_tag[index]
if len(all_category_tag_list) > 0:
index = randint(0, len(all_category_tag_list) - 1)
return all_category_tag_list[index]
else:
return 0
......
......@@ -498,19 +498,21 @@ def get_category_reply_commtent(category_id):
try:
# 发型42、穿搭46、美妆3、护肤4、美甲21972、香水17576、瘦身32605、配饰5305608
file = ""
if category_id == 3: # 美妆
logging.info("3-------------")
file = "/srv/apps/physical/vest/data/beauty_reply_data.txt"
if category_id == 42: # 发型
elif category_id == 42: # 发型
logging.info("42-------------")
file = "/srv/apps/physical/vest/data/hairstyle_reply_data.txt"
if category_id == 4: # 护肤
elif category_id == 4: # 护肤
logging.info("4-------------")
file = "/srv/apps/physical/vest/data/skincare_reply_data.txt"
if category_id == 46: # 穿搭
elif category_id == 46: # 穿搭
logging.info("46-------------")
file = "/srv/apps/physical/vest/data/wear_repy_data.txt"
else:
comment = get_comment()
return comment
data = open(file, "r")
list_guanshui = []
for i in data:
......
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