|
@@ -13,7 +13,7 @@ def title():
|
|
|
sum(view_count) view_times,
|
|
|
group_concat(distinct book) novels,
|
|
|
max(dt) end_date,min(dt) start_date
|
|
|
- from dw_image_cost_day where title!='' and title is not null GROUP BY REPLACE(REPLACE(title, CHAR(10), ''), CHAR(13), '') limit 1000
|
|
|
+ from dw_image_cost_day where title!='' and title is not null GROUP BY REPLACE(REPLACE(title, CHAR(10), ''), CHAR(13), '')
|
|
|
"""
|
|
|
|
|
|
df = db.dm.getData_pd(sql)
|
|
@@ -26,7 +26,7 @@ def title():
|
|
|
tag = ["view_times", "click_times", "novels", "start_date", "end_date", "create_by",'data_type', 'consume_amount']
|
|
|
table = "t_ads_content"
|
|
|
|
|
|
- db.zx_test.dfsave2mysql(df, table, key, tag)
|
|
|
+ db.zx_ads.dfsave2mysql(df, table, key, tag)
|
|
|
|
|
|
def description():
|
|
|
sql = """select REPLACE(REPLACE(description, CHAR(10), ''), CHAR(13), '') content,
|
|
@@ -35,7 +35,7 @@ def description():
|
|
|
sum(view_count) view_times,
|
|
|
group_concat(distinct book) novels,
|
|
|
max(dt) end_date,min(dt) start_date
|
|
|
- from dw_image_cost_day where description!='' and description is not null GROUP BY REPLACE(REPLACE(description, CHAR(10), ''), CHAR(13), '') limit 1000
|
|
|
+ from dw_image_cost_day where description!='' and description is not null GROUP BY REPLACE(REPLACE(description, CHAR(10), ''), CHAR(13), '')
|
|
|
"""
|
|
|
|
|
|
df = db.dm.getData_pd(sql)
|
|
@@ -48,7 +48,7 @@ def description():
|
|
|
tag = ["view_times", "click_times", "novels", "start_date", "end_date", "create_by",'data_type', 'consume_amount']
|
|
|
table = "t_ads_content"
|
|
|
|
|
|
- db.zx_test.dfsave2mysql(df, table, key, tag)
|
|
|
+ db.zx_ads.dfsave2mysql(df, table, key, tag)
|
|
|
|
|
|
|
|
|
def image():
|
|
@@ -62,7 +62,7 @@ def image():
|
|
|
min(preview_url) content,
|
|
|
if(is_video=1,2,1) type,
|
|
|
if(locate(',',signature)>0,0,1) single_img
|
|
|
- from dw_image_cost_day where signature is not null and signature !='' GROUP BY signature,is_video limit 1000"""
|
|
|
+ from dw_image_cost_day where signature is not null and signature !='' GROUP BY signature,is_video"""
|
|
|
|
|
|
df = db.dm.getData_pd(sql)
|
|
|
# print(df)
|
|
@@ -74,7 +74,7 @@ def image():
|
|
|
tag = ["view_times", "click_times", "novels", "start_date", "end_date", "create_by", "single_img", "content",'consume_amount','type']
|
|
|
table = "t_ads_media"
|
|
|
|
|
|
- db.zx_test.dfsave2mysql(df, table, key, tag)
|
|
|
+ db.zx_ads.dfsave2mysql(df, table, key, tag)
|
|
|
|
|
|
|
|
|
|
|
@@ -101,11 +101,11 @@ from dw_image_cost_day where signature is not null and signature!='' GROUP BY
|
|
|
tag = ["view_times", "click_times", "novels", "start_date", "end_date","type","channel",'consume_amount','single_img','media']
|
|
|
table = "t_ads_idea"
|
|
|
|
|
|
- db.zx_test.dfsave2mysql(df, table, key, tag)
|
|
|
+ db.zx_ads.dfsave2mysql(df, table, key, tag)
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
- # title()
|
|
|
- # description()
|
|
|
+ title()
|
|
|
+ description()
|
|
|
image()
|
|
|
adcreative()
|