|
@@ -82,10 +82,29 @@ def get_v_data(y,li):
|
|
|
d['account_id'] = y[0]
|
|
|
x = tuple(d.values())
|
|
|
li.append(x)
|
|
|
+def mysql_select(sql):
|
|
|
+ db = pymysql.connect('rm-bp1c9cj79872tx3aaro.mysql.rds.aliyuncs.com', 'superc', 'Cc719199895', 'quchen_text')
|
|
|
+ cur=db.cursor()
|
|
|
+ cur.execute(sql)
|
|
|
+ data=cur.fetchall()
|
|
|
+ return data
|
|
|
+def get_vx_list():
|
|
|
+ sql="select account_id,wechat_account_id,access_token,refresh_token,name," \
|
|
|
+ "ifnull(stage,''),ifnull(pitcher,''),ifnull(platform,''),ifnull(book,'') from advertiser_vx"
|
|
|
+ a= mysql_select(sql)
|
|
|
+ return a
|
|
|
+
|
|
|
+def get_qq_list():
|
|
|
+ sql = "select account_id,'',access_token,refresh_token,name," \
|
|
|
+ "ifnull(stage,''),ifnull(pitcher,''),ifnull(platform,''),ifnull(book,'') from advertiser_qq"
|
|
|
+ a = mysql_select(sql)
|
|
|
+ return a
|
|
|
|
|
|
|
|
|
def get_daily_vx():
|
|
|
- token_list_v = tl.token_list_vx
|
|
|
+ token_list_v =get_vx_list()
|
|
|
+ print("获取vx账号:",token_list_v.__len__())
|
|
|
+
|
|
|
time1 = time.time()
|
|
|
executor = ThreadPoolExecutor(max_workers=max_workers)
|
|
|
li=[]
|
|
@@ -98,7 +117,8 @@ def get_daily_vx():
|
|
|
return li
|
|
|
|
|
|
def get_daily_qq():
|
|
|
- token_list_q = tl.token_list_qq
|
|
|
+ token_list_q = get_qq_list()
|
|
|
+ print("获取qq账号:",token_list_q.__len__())
|
|
|
time1 = time.time()
|
|
|
li=[]
|
|
|
executor = ThreadPoolExecutor(max_workers=max_workers)
|
|
@@ -199,13 +219,13 @@ if __name__ == '__main__':
|
|
|
start_cost_job()
|
|
|
|
|
|
# run history data
|
|
|
- # i=3
|
|
|
+ # i=1
|
|
|
# while True:
|
|
|
# my_time=(datetime.today()-timedelta(days=i)).strftime('%Y-%m-%d')
|
|
|
# print("run["+my_time+"]data")
|
|
|
# start_cost_job()
|
|
|
# i+=1
|
|
|
- # if my_time=='2020-10-01':
|
|
|
+ # if my_time=='2020-12-09':
|
|
|
# break
|
|
|
|
|
|
|