Commit 4bd367fb authored by lixiaofang's avatar lixiaofang

add

parent a654b975
...@@ -20,19 +20,19 @@ def get_data(numtime, numtime2): ...@@ -20,19 +20,19 @@ 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]))
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
if user_id: if (user_id and user_id["is_shadow"] == 0) or len(data) == 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 []
......
...@@ -19,19 +19,18 @@ def get_data(numtime, numtime2): ...@@ -19,19 +19,18 @@ 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 from user_extra where user_id =" + str(i[0]))
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
if user_id: if (user_id and user_id["is_shadow"] == 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 []
......
...@@ -21,7 +21,6 @@ def get_data(numtime, numtime2): ...@@ -21,7 +21,6 @@ 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 from user_extra where user_id =" + str(i[0]) + " and is_shadow =0")
...@@ -31,9 +30,9 @@ def get_data(numtime, numtime2): ...@@ -31,9 +30,9 @@ def get_data(numtime, numtime2):
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 []
......
...@@ -121,9 +121,7 @@ def login(): ...@@ -121,9 +121,7 @@ def login():
try: try:
user_id = get_majia() user_id = get_majia()
logging.info("get user_id:%s" % user_id) logging.info("get user_id:%s" % user_id)
cookies = get_cookies(user_id) cookies = get_cookies(user_id)
cookies = "yhlcnc7q3louskthgpjguoi5n7r326cm"
if cookies is not None: if cookies is not None:
return {'sessionid': cookies} return {'sessionid': cookies}
except: except:
...@@ -134,7 +132,7 @@ def login(): ...@@ -134,7 +132,7 @@ def login():
def logins(user_id): def logins(user_id):
try: try:
cookies = get_cookies(user_id) cookies = get_cookies(user_id)
cookies = "yhlcnc7q3louskthgpjguoi5n7r326cm" # cookies = "yhlcnc7q3louskthgpjguoi5n7r326cm"
if cookies is not None: if cookies is not None:
return {'sessionid': cookies} return {'sessionid': cookies}
......
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