Commit f62a2931 authored by lixiaofang's avatar lixiaofang

add

parent f2142cd4
......@@ -2,9 +2,9 @@ import pymysql
import random
import traceback
import logging
from vest.request.auto_request import logins, pictorial_reply, get_majia, get_pictorial_comment, time_conv_minute
from vest.request.auto_request import logins, pictorial_reply, get_majia, get_pictorial_comment, time_conv_minute, \
judge_pictorial_info_get_comment
from vest.request.auto_request import host, user, db, passwd
from vest.data.topic_models import get_pictorial_tag_by_id
"""
榜单新增内容(仅限在线的)
......@@ -74,14 +74,7 @@ def principal_online_comment1():
for num in range(random_num):
majia_user_id = get_majia()
cook = logins(majia_user_id)
comment = ""
# 判断是不是编辑标签
edit_judge = get_pictorial_tag_by_id(i[0])
if edit_judge:
rand_tag_id = random.randint(0, len(edit_judge) - 1)
comment = get_pictorial_comment()
else:
comment = get_pictorial_comment()
comment = get_pictorial_comment()
if cook is not None:
pictorial_reply(cook, i[0], comment)
if data_vote:
......@@ -90,15 +83,9 @@ def principal_online_comment1():
for num in range(random_num):
majia_user_id = get_majia()
cook = logins(majia_user_id)
edit_judge = get_pictorial_tag_by_id(i[0])
if edit_judge:
rand_tag_id = random.randint(0, len(edit_judge) - 1)
comment = get_pictorial_comment()
else:
comment = get_pictorial_comment()
comment = get_pictorial_comment()
if cook is not None:
pictorial_reply(cook, i[0], comment)
else:
logging.error("catch exception,main:%s" % traceback.format_exc())
except:
......
......@@ -5,9 +5,6 @@ from vest.request.auto_request import login, time_conv, get_comment, reply, get_
get_category_tag_id, get_category_reply_commtent,judge_topic_info_get_comment
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
from vest.data.topic_models import get_edit_tag_id_list, get_pictorial_tag_by_id, get_topic_product_info, \
topic_has_image
import random
def get_data(numtime, numtime2):
......
......@@ -590,3 +590,28 @@ def judge_topic_info_get_comment(topic_id):
logging.error("catch exception,logins:%s" % traceback.format_exc())
return None
def judge_pictorial_info_get_comment(topic_id):
try:
comment = ""
# 先判断是不是编辑标签
edit_tag_list = get_pictorial_tag_by_id(topic_id)
if len(edit_tag_list) > 0:
# 如果有编辑标签
# 去拿他的所属分类 根据分类去拿对应的标签(随机拿一个)
category_tag_id = get_category_tag_id(edit_tag_list)
if category_tag_id > 0:
comment = get_category_reply_commtent(category_tag_id)
else:
comment = get_pictorial_comment()
else:
# 原始评论
comment = get_comment()
logging.info("get judge_topic_info_get_comment:%s" % comment)
return comment
except:
logging.error("catch exception,logins:%s" % traceback.format_exc())
return None
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