Commit 27e3853a authored by 吴升宇's avatar 吴升宇

Merge branch 'wsy3' into 'test'

Wsy3

See merge request !527
parents 9ea1a05d cf6a8771
...@@ -28,7 +28,7 @@ def get_commnet_id(numtime, numtime2, content_level_low=0, content_level_top=6): ...@@ -28,7 +28,7 @@ def get_commnet_id(numtime, numtime2, content_level_low=0, content_level_top=6):
"SELECT pictorial_id FROM community_pictorial_topic where topic_id=%s limit 1" % i) "SELECT pictorial_id FROM community_pictorial_topic where topic_id=%s limit 1" % i)
pictorial_id = cursor.fetchall() pictorial_id = cursor.fetchall()
if pictorial_id is not None: if pictorial_id:
topic_ids.append((i, pictorial_id[0])) topic_ids.append((i, pictorial_id[0]))
else: else:
topic_ids.append((i, 0)) topic_ids.append((i, 0))
......
...@@ -29,7 +29,7 @@ def get_commnet_id(numtime, numtime2, content_level_low=0, content_level_top=6): ...@@ -29,7 +29,7 @@ def get_commnet_id(numtime, numtime2, content_level_low=0, content_level_top=6):
"SELECT pictorial_id FROM community_pictorial_topic where topic_id=%s limit 1" % i) "SELECT pictorial_id FROM community_pictorial_topic where topic_id=%s limit 1" % i)
pictorial_id = cursor.fetchall() pictorial_id = cursor.fetchall()
if pictorial_id is not None: if pictorial_id:
topic_ids.append((i, pictorial_id[0])) topic_ids.append((i, pictorial_id[0]))
else: else:
topic_ids.append((i, 0)) topic_ids.append((i, 0))
......
...@@ -38,7 +38,7 @@ def get_data(numtime1, numtime2): ...@@ -38,7 +38,7 @@ def get_data(numtime1, numtime2):
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 pictorial_id ,count(*) as count FROM community_pictorial_topic WHERE is_online=1 and (create_time >= '%s' and create_time < '%s') group by pictorial_id " % ( "SELECT pictorial_id FROM community_pictorial_topic WHERE is_online=1 and (create_time >= '%s' and create_time < '%s') group by pictorial_id " % (
numtime1, numtime2)) numtime1, numtime2))
res = cursor.fetchall() res = cursor.fetchall()
...@@ -87,6 +87,9 @@ def auto_reply_per_1d_to_pictorial(): ...@@ -87,6 +87,9 @@ def auto_reply_per_1d_to_pictorial():
except: except:
logging.error("catch exception,main:%s" % traceback.format_exc()) logging.error("catch exception,main:%s" % traceback.format_exc())
logging.info('auto_click_per_2h_by_post: len %s' % len(pictorial_id_list))
print('auto_click_per_2h_by_post: len %s' % len(pictorial_id_list))
total = len(pictorial_id_list) total = len(pictorial_id_list)
limit = (total + 10) // 10 limit = (total + 10) // 10
for start in range(0, total, limit): for start in range(0, total, limit):
......
...@@ -14,7 +14,7 @@ def get_data(numtime, numtime2, content_level_low, content_level_top): ...@@ -14,7 +14,7 @@ def get_data(numtime, numtime2, content_level_low, content_level_top):
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 user_id,id FROM topic WHERE is_online=1 and (create_time >= '%s' and create_time <= '%s' )" "SELECT id FROM topic WHERE is_online=1 and (create_time >= '%s' and create_time <= '%s' )"
"and content_level>= %s and content_level<= %s" % ( "and content_level>= %s and content_level<= %s" % (
numtime2, numtime, str(content_level_low), str(content_level_top))) numtime2, numtime, str(content_level_low), str(content_level_top)))
res = cursor.fetchall() res = cursor.fetchall()
...@@ -78,6 +78,9 @@ def auto_reply_per_1d_to_topic(): ...@@ -78,6 +78,9 @@ def auto_reply_per_1d_to_topic():
logging_exception() logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc()) logging.error("catch exception,main:%s" % traceback.format_exc())
logging.info('auto_click_per_2h_by_post: len %s' % len(topic_id_list))
print('auto_click_per_2h_by_post: len %s' % len(topic_id_list))
total = len(topic_id_list) total = len(topic_id_list)
limit = (total + 10) // 10 limit = (total + 10) // 10
for start in range(0, total, limit): for start in range(0, total, limit):
......
...@@ -14,7 +14,7 @@ def get_data(numtime, numtime2): ...@@ -14,7 +14,7 @@ def get_data(numtime, numtime2):
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 user_id,id FROM topic WHERE is_online=1 and (create_time >= '%s' and create_time <= '%s' )" % ( "SELECT user_id FROM topic WHERE is_online=1 and (create_time >= '%s' and create_time <= '%s' )" % (
numtime2, numtime)) numtime2, numtime))
res = cursor.fetchall() res = cursor.fetchall()
return res and [r for r, in res] or [] return res and [r for r, in res] or []
...@@ -50,6 +50,10 @@ def auto_reply_per_2h_to_topic(): ...@@ -50,6 +50,10 @@ def auto_reply_per_2h_to_topic():
logging_exception() logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc()) logging.error("catch exception,main:%s" % traceback.format_exc())
logging.info('auto_click_per_2h_by_post: len %s' % len(topic_id_list))
print('auto_click_per_2h_by_post: len %s' % len(topic_id_list))
total = len(topic_id_list) total = len(topic_id_list)
limit = (total + 10) // 10 limit = (total + 10) // 10
for start in range(0, total, limit): for start in range(0, total, limit):
......
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