Commit d385bd59 authored by lixiaofang's avatar lixiaofang

is_shadow

parent f90aca94
...@@ -23,10 +23,11 @@ def get_data(numtime, numtime2): ...@@ -23,10 +23,11 @@ def get_data(numtime, numtime2):
try: try:
for i in topic_id and topic_id: for i in topic_id and topic_id:
cursor.execute( cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0") "select user_id,is_shadow from user_extra where user_id =" + str(
i[0]) + " and is_online =1 and is_deleted =0")
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
if user_id: if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
topic_id_list.append(i) topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
......
...@@ -23,10 +23,11 @@ def get_data(numtime, numtime2): ...@@ -23,10 +23,11 @@ def get_data(numtime, numtime2):
try: try:
for i in topic_id and topic_id: for i in topic_id and topic_id:
cursor.execute( cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0") "select user_id,is_shadow from user_extra where user_id =" + str(
i[0]) + " and is_online =1 and is_deleted =0")
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
if user_id: if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
topic_id_list.append(i) topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
......
...@@ -19,19 +19,20 @@ def get_data(numtime, numtime2): ...@@ -19,19 +19,20 @@ def get_data(numtime, numtime2):
topic_id = list(data) topic_id = list(data)
topic_id_list = [] topic_id_list = []
logging.info("get topic_id:%s" % topic_id) logging.info("get topic_id:%s" % topic_id)
try:
for i in topic_id and topic_id: for i in topic_id and topic_id:
cursor.execute( cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0") "select user_id,is_shadow from user_extra where user_id =" + str(
i[0]) + " and is_online =1 and is_deleted =0")
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
if user_id: logging.info("get user_id:%s" % user_id)
if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
topic_id_list.append(i) topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
except:
pass
return topic_id_list return topic_id_list
except: except:
logging.error("catch exception,get_data:%s" % traceback.format_exc()) logging.error("catch exception,get_data:%s" % traceback.format_exc())
return [] return []
......
...@@ -23,10 +23,11 @@ def get_data(numtime, numtime2): ...@@ -23,10 +23,11 @@ def get_data(numtime, numtime2):
try: try:
for i in topic_id and topic_id: for i in topic_id and topic_id:
cursor.execute( cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0") "select user_id,is_shadow from user_extra where user_id =" + str(
i[0]) + " and is_online =1 and is_deleted =0")
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
if user_id: if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
topic_id_list.append(i) topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
......
...@@ -24,10 +24,11 @@ def get_data(numtime, numtime2): ...@@ -24,10 +24,11 @@ def get_data(numtime, numtime2):
try: try:
for i in topic_id and topic_id: for i in topic_id and topic_id:
cursor.execute( cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0") "select user_id,is_shadow from user_extra where user_id =" + str(
i[0]) + " and is_online =1 and is_deleted =0")
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
if user_id: if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
topic_id_list.append(i) topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
......
...@@ -14,15 +14,16 @@ def get_data(numtime1, numtime2): ...@@ -14,15 +14,16 @@ def get_data(numtime1, numtime2):
"SELECT distinct(user_id) FROM topic WHERE is_online=1 and create_time > '%s' and create_time < '%s'" % ( "SELECT distinct(user_id) FROM topic WHERE is_online=1 and create_time > '%s' and create_time < '%s'" % (
numtime1, numtime2)) numtime1, numtime2))
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) topic_id = list(data)
topic_id_list = [] topic_id_list = []
if user_id: if topic_id:
for i in user_id: for i in topic_id:
cursor.execute( cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0") "select user_id,is_shadow from user_extra where user_id =" + str(
i[0]) + " and is_online =1 and is_deleted =0")
data = cursor.fetchall() data = cursor.fetchall()
id = list(data) user_id = list(data)
if id: if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
topic_id_list.append(i) topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
......
...@@ -45,52 +45,24 @@ def get_commnet_id(numtime): ...@@ -45,52 +45,24 @@ def get_commnet_id(numtime):
data2_id = list(data_group_follow) data2_id = list(data_group_follow)
data3_id = list(data_new_user) data3_id = list(data_new_user)
data_reply = list(data_reply_reply) data_reply = list(data_reply_reply)
all_data = []
all_data.extend(data_id)
all_data.extend(data2_id)
all_data.extend(data3_id)
all_data.extend(data_reply)
all_data.extend(data1_id)
topic_id_list = [] topic_id_list = []
for i in data_id and data_id: for i in all_data and all_data:
cursor.execute( cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ") "select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
if user_id: if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
topic_id_list.append(i)
for i in data1_id and data1_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
for i in data2_id and data2_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
for i in data3_id and data3_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
for i in data_reply and data_reply:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i) topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
return topic_id_list return topic_id_list
......
...@@ -20,11 +20,11 @@ def get_data(numtime, numtime2): ...@@ -20,11 +20,11 @@ def get_data(numtime, numtime2):
try: try:
for i in topic_id and topic_id: for i in topic_id and topic_id:
cursor.execute( cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0") "select user_id,is_shadow from user_extra where user_id =" + str(
i[0]) + " and is_online =1 and is_deleted =0")
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
print(user_id) if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
if user_id:
topic_id_list.append(i) topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
......
...@@ -22,11 +22,11 @@ def get_data(numtime, numtime2): ...@@ -22,11 +22,11 @@ def get_data(numtime, numtime2):
try: try:
for i in topic_id and topic_id: for i in topic_id and topic_id:
cursor.execute( cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0") "select user_id,is_shadow from user_extra where user_id =" + str(
i[0]) + " and is_online =1 and is_deleted =0")
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
print(user_id) if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
if user_id:
topic_id_list.append(i) topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
......
...@@ -21,11 +21,11 @@ def get_data(numtime, numtime2): ...@@ -21,11 +21,11 @@ def get_data(numtime, numtime2):
try: try:
for i in topic_id and topic_id: for i in topic_id and topic_id:
cursor.execute( cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0") "select user_id,is_shadow from user_extra where user_id =" + str(
i[0]) + " and is_online =1 and is_deleted =0")
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
print(user_id) if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
if user_id:
topic_id_list.append(i) topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
......
...@@ -22,10 +22,11 @@ def get_data(numtime, numtime2): ...@@ -22,10 +22,11 @@ def get_data(numtime, numtime2):
try: try:
for i in topic_id and topic_id: for i in topic_id and topic_id:
cursor.execute( cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0") "select user_id,is_shadow from user_extra where user_id =" + str(
i[0]) + " and is_online =1 and is_deleted =0")
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
if user_id: if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
topic_id_list.append(i) topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
......
...@@ -21,11 +21,12 @@ def get_data(numtime, numtime2): ...@@ -21,11 +21,12 @@ def get_data(numtime, numtime2):
try: try:
for i in topic_id and topic_id: for i in topic_id and topic_id:
cursor.execute( cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0") "select user_id,is_shadow from user_extra where user_id =" + str(
i[0]) + " and is_online =1 and is_deleted =0")
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
print(user_id) print(user_id)
if user_id: if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
topic_id_list.append(i) topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
......
...@@ -20,11 +20,12 @@ def get_data(numtime, numtime2): ...@@ -20,11 +20,12 @@ def get_data(numtime, numtime2):
try: try:
for i in topic_id and topic_id: for i in topic_id and topic_id:
cursor.execute( cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0") "select user_id,is_shadow from user_extra where user_id =" + str(
i[0]) + " and is_online =1 and is_deleted =0")
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
print(user_id) print(user_id)
if user_id: if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
topic_id_list.append(i) topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
......
...@@ -18,10 +18,11 @@ def get_star_useid(numtime1, numtime2): ...@@ -18,10 +18,11 @@ def get_star_useid(numtime1, numtime2):
topic_id_list = [] topic_id_list = []
for i in user_id and user_id: for i in user_id and user_id:
cursor.execute( cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ") "select user_id,is_shadow from user_extra where user_id =" + str(
i[0]) + " and is_online =1 and is_deleted =0")
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
if user_id: if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
topic_id_list.append(i) topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
......
...@@ -20,10 +20,11 @@ def get_data(numtime1, numtime2): ...@@ -20,10 +20,11 @@ def get_data(numtime1, numtime2):
topic_id_list = [] topic_id_list = []
for i in user_id and user_id: for i in user_id and user_id:
cursor.execute( cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ") "select user_id,is_shadow from user_extra where user_id =" + str(
i[0]) + " and is_online =1 and is_deleted =0")
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
if user_id: if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
topic_id_list.append(i) topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
......
...@@ -20,10 +20,11 @@ def get_data(numtime1, numtime2): ...@@ -20,10 +20,11 @@ def get_data(numtime1, numtime2):
topic_id_list = [] topic_id_list = []
for i in user_id and user_id: for i in user_id and user_id:
cursor.execute( cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ") "select user_id,is_shadow from user_extra where user_id =" + str(
i[0]) + " and is_online =1 and is_deleted =0")
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
if user_id: if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
topic_id_list.append(i) topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
......
...@@ -41,11 +41,12 @@ def get_data(now, noww): ...@@ -41,11 +41,12 @@ def get_data(now, noww):
topic_id_list = [] topic_id_list = []
for id in topic_id: for id in topic_id:
cursor.execute( cursor.execute(
"select user_id from user_extra where user_id =" + str(id[1]) + " and is_shadow =1") "select user_id,is_shadow from user_extra where user_id =" + str(
id[0]) + " and is_online =1 and is_deleted =0")
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
if user_id: if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
topic_id_list.append(i) topic_id_list.append(id)
pc.close() pc.close()
logging.info("get topic_id_list:%s" % topic_id_list) logging.info("get topic_id_list:%s" % topic_id_list)
return topic_id_list return topic_id_list
......
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