Commit 5855c068 authored by 段英荣's avatar 段英荣

Merge branch 'fix_pictorial' into 'master'

Fix pictorial

See merge request !426
parents a5479475 abc582e9
......@@ -15,12 +15,15 @@ def get_data():
print("....")
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute(
"select creator_id,id from community_pictorial where is_online =True and is_deleted=False and id not in (select pictorial_id from reply group by pictorial_id)")
cursor.execute("select count(*),pictorial_id from reply group by pictorial_id")
data = cursor.fetchall()
topic_id = list(data)
data_all = []
for i in topic_id:
if i[0] <= 4:
data_all.append(i)
logging.info("Database version : %s " % topic_id)
return topic_id
return data_all
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
......@@ -31,9 +34,9 @@ def no_reply_principal():
try:
logging.info("comment offline pictorial")
user_id = get_data()
dicts = {}
for i in user_id:
for num in range(4):
follow_num = random.randint(1, 5)
for num in range(follow_num):
majia_user_id = get_majia_reply(i[0])
cook = logins(majia_user_id)
comment = get_pictorial_comment()
......
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