Commit 477fb158 authored by lixiaofang's avatar lixiaofang

add

parent 6c7180e2
This diff is collapsed.
...@@ -39,13 +39,12 @@ def reply(id, content, user_id): ...@@ -39,13 +39,12 @@ def reply(id, content, user_id):
logging.error("catch exception,logins:%s" % traceback.format_exc()) logging.error("catch exception,logins:%s" % traceback.format_exc())
def get_data(numtime, numtime2): def get_data(num1,num2):
try: try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306) pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor() cursor = pc.cursor()
cursor.execute( cursor.execute(
"SELECT id,user_id FROM topic WHERE is_online =1 and (create_time < %s and create_time > %s) and (content_level = 4 or content_level = 5) and user_id in (select user_id from user_extra where is_shadow = 1)", "SELECT id,user_id FROM topic WHERE is_online =1 and (id > "+str(num1)+" and id <= "+str(num2)+") and (content_level = 4 or content_level = 5) and user_id in (select user_id from user_extra where is_shadow = 1)")
(numtime, numtime2))
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
logging.info("Database version : %s " % user_id) logging.info("Database version : %s " % user_id)
...@@ -60,9 +59,9 @@ if __name__ == "__main__": ...@@ -60,9 +59,9 @@ if __name__ == "__main__":
try: try:
time_list = [["2011-03-30 15:57:49.000000", "2010-03-30 15:57:49.000000"]] time_list = [[0, 10000],[10000,20000]]
# ["2015-03-30 15:57:49.000000", "2012-03-30 15:57:49.000000"], # [10000, 20000],
# ["2016-03-30 15:57:49.000000", "2015-03-30 15:57:49.000000"], # [20000, 30000],
# ["2017-03-30 15:57:49.000000", "2016-03-30 15:57:49.000000"], # ["2017-03-30 15:57:49.000000", "2016-03-30 15:57:49.000000"],
# ["2018-03-30 15:57:49.000000", "2017-03-30 15:57:49.000000"], # ["2018-03-30 15:57:49.000000", "2017-03-30 15:57:49.000000"],
# ["2019-03-30 15:57:49.000000", "2018-03-30 15:57:49.000000"]] # ["2019-03-30 15:57:49.000000", "2018-03-30 15:57:49.000000"]]
...@@ -72,7 +71,6 @@ if __name__ == "__main__": ...@@ -72,7 +71,6 @@ if __name__ == "__main__":
user_list = [] user_list = []
for i in user_data.readlines(): for i in user_data.readlines():
user_list.append(i) user_list.append(i)
for i in time_list: for i in time_list:
...@@ -92,7 +90,6 @@ if __name__ == "__main__": ...@@ -92,7 +90,6 @@ if __name__ == "__main__":
user_id = user_list[num] user_id = user_list[num]
if user_id != id[1]: if user_id != id[1]:
comment_list = get_offline_comment() comment_list = get_offline_comment()
comment = comment_list[i] comment = comment_list[i]
......
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