Commit 58141833 authored by 吴升宇's avatar 吴升宇

fix auto follow

parent e4ab53b2
......@@ -14,10 +14,11 @@ def get_commnet_id(numtime, numtime2):
cursor = pc.cursor()
# 注册后
# todo 这个查询太慢了,加一个limit
cursor.execute(
"select a.user_id, u.is_shadow from account_user a left join user_extra u on a.user_id = u.user_id "
"WHERE a.create_time > '%s' and a.create_time < '%s' " % (numtime, numtime2))
"WHERE a.create_time > '%s' and a.create_time < '%s' limit 10000" % (numtime, numtime2))
res = cursor.fetchall()
return res and [i for (i, is_shadow) in res if is_shadow != 1] or []
......@@ -59,7 +60,8 @@ def auto_follow_per_1d_by_regist():
# 10天前注册:每隔12天[0-1]个赞
numtime1, numtime2 = time_convs(1, 12)
user_ids = get_commnet_id('0', numtime2)
# todo 加一个过滤时间
user_ids = get_commnet_id('2019-05-11', numtime2)
for user_id in user_ids:
follow_num = random.randint(1, 24)
if follow_num == 12:
......
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