Commit 29553b5d authored by lixiaofang's avatar lixiaofang

try except

parent fecd87b1
This diff is collapsed.
......@@ -161,7 +161,7 @@ def get_new_user_id(numtime):
db="alpha", port=3306)
cursor = db.cursor()
cursor.execute(
"select user_id from account_user WHERE create_time LIKE '%%%%%s%%%%'" % numtime)
"select user_id from account_user WHERE is_online =1 and create_time LIKE '%%%%%s%%%%'" % numtime)
data_new_user = cursor.fetchall()
data = list(data_new_user)
logging.info("Database version : %s " % data)
......@@ -181,7 +181,8 @@ def get_star_useid(numtime):
"SELECT user_id FROM topic WHERE content_level =4 or content_level =5 and create_time LIKE '%%%%%s%%%%'" % numtime)
data = cursor.fetchall()
user_id = list(data)
logging.info("Database version : %s " % data)
logging.info("Database version : %s " % user_id)
db.close()
return user_id
except:
......
......@@ -134,10 +134,10 @@ def get_star_user_id(numtime):
db="alpha", port=3306)
cursor = db.cursor()
cursor.execute(
"SELECT user_id FROM topic WHERE content_level =4 or content_level =5 and create_time LIKE '%%%%%s%%%%'" % numtime)
"SELECT user_id FROM topic WHERE is_online=1 and content_level =4 or content_level =5 and create_time LIKE '%%%%%s%%%%'" % numtime)
data = cursor.fetchall()
user_id = list(data)
logging.info("Database version : %s " % data)
logging.info("Database version : %s " % user_id)
db.close()
return user_id
except:
......@@ -153,7 +153,7 @@ def get_star_topic_id(numtime):
"SELECT id FROM topic WHERE is_online=1 and content_level =4 or content_level =5 and create_time LIKE '%%%%%s%%%%'" % numtime)
data = cursor.fetchall()
user_id = list(data)
logging.info("Database version : %s " % data)
logging.info("Database version : %s " % user_id)
db.close()
return user_id
except:
......
......@@ -89,8 +89,6 @@ def Urge(cookies_get, id):
cookies=cookies_get,
data=post_dict)
print(response.text, 'url')
logging.info("response.text:%s" % response.text)
except:
......@@ -112,10 +110,10 @@ def get_data(numtime):
db = pymysql.connect(host="rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com", user='work', passwd='Gengmei123',
db="alpha", port=3306)
cursor = db.cursor()
cursor.execute("SELECT distinct(user_id) FROM topic WHERE create_time LIKE '%%%%%s%%%%'" % numtime)
cursor.execute("SELECT distinct(user_id) FROM topic WHERE is_online=1 and create_time LIKE '%%%%%s%%%%'" % numtime)
data = cursor.fetchall()
user_id = list(data)
logging.info("Database version : %s " % data)
logging.info("Database version : %s " % user_id)
db.close()
return user_id
except:
......@@ -131,7 +129,7 @@ def get_star_useid(numtime):
"SELECT user_id FROM topic WHERE content_level =4 or content_level =5 and create_time LIKE '%%%%%s%%%%'" % numtime)
data = cursor.fetchall()
user_id = list(data)
logging.info("Database version : %s " % data)
logging.info("Database version : %s " % user_id)
db.close()
return user_id
except:
......
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