data_stat_task.py 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. from model.DataBaseUtils import MysqlUtils, CkUtils
  2. from datetime import datetime, timedelta, timezone
  3. from model.DateUtils import DateUtils
  4. import logging
  5. import time
  6. db = MysqlUtils()
  7. ck = CkUtils()
  8. dt = DateUtils()
  9. def platform_data_sum(ymd):
  10. logging.info('dw_daily_platform_cost开始数据更新')
  11. ck.execute("alter table game_data.dw_daily_platform_cost drop partition '{}' ".format(ymd))
  12. sql = f'''
  13. insert into game_data.dw_daily_platform_cost
  14. select * from game_data.dw_daily_channel_cost b where dt='{ymd}'
  15. '''
  16. ck.execute(sql)
  17. logging.info('dw_daily_platform_cost数据更新,结束')
  18. def dw_daily_channel_cost(ymd):
  19. def table_name(datatime_tmp, datatime_realtime):
  20. datatime_use = min(datatime_tmp, datatime_realtime)
  21. str_year = datatime_use.tm_year
  22. str_mon = datatime_use.tm_mon
  23. str_mon = str_mon if str_mon > 9 else '0' + str(str_mon)
  24. res = 'h_log_mem_login_{}{}'.format(str_year, str_mon)
  25. return res
  26. logging.info("run> dw_daily_channel_cost")
  27. datatime_ymd = datetime.strptime(ymd, '%Y-%m-%d').astimezone(timezone(timedelta(hours=8))).timetuple()
  28. datatime_ymd_tom = (datetime.strptime(ymd, '%Y-%m-%d').astimezone(timezone(timedelta(hours=8))) + timedelta(
  29. days=1)).timetuple()
  30. datatime_ymd_tom_after = (datetime.strptime(ymd, '%Y-%m-%d').astimezone(timezone(timedelta(hours=8))) + timedelta(
  31. days=2)).timetuple()
  32. datatime_ymd_seven_day = (datetime.strptime(ymd, '%Y-%m-%d').astimezone(timezone(timedelta(hours=8))) + timedelta(
  33. days=7)).timetuple()
  34. datatime_ymd_fifteen_day = (datetime.strptime(ymd, '%Y-%m-%d').astimezone(timezone(timedelta(hours=8))) + timedelta(
  35. days=15)).timetuple()
  36. datatime_ymd_thirty_day = (datetime.strptime(ymd, '%Y-%m-%d').astimezone(timezone(timedelta(hours=8))) + timedelta(
  37. days=30)).timetuple()
  38. datatime_ymd_fortyfive_day = (
  39. datetime.strptime(ymd, '%Y-%m-%d').astimezone(timezone(timedelta(hours=8))) + timedelta(
  40. days=45)).timetuple()
  41. datatime_ymd_sixty_day = (datetime.strptime(ymd, '%Y-%m-%d').astimezone(timezone(timedelta(hours=8))) + timedelta(
  42. days=60)).timetuple()
  43. datatime_realtime = datetime.now().timetuple()
  44. # datatime_str
  45. ymd_tom = (datetime.strptime(ymd, '%Y-%m-%d').astimezone(timezone(timedelta(hours=8))) + timedelta(
  46. days=1)).strftime('%Y-%m-%d')
  47. ymd_tom_after = (datetime.strptime(ymd, '%Y-%m-%d').astimezone(timezone(timedelta(hours=8))) + timedelta(
  48. days=2)).strftime('%Y-%m-%d')
  49. ymd_seven_day = (datetime.strptime(ymd, '%Y-%m-%d').astimezone(timezone(timedelta(hours=8))) + timedelta(
  50. days=7)).strftime('%Y-%m-%d')
  51. ymd_fifteen_day = (datetime.strptime(ymd, '%Y-%m-%d').astimezone(timezone(timedelta(hours=8))) + timedelta(
  52. days=15)).strftime('%Y-%m-%d')
  53. ymd_thirty_day = (datetime.strptime(ymd, '%Y-%m-%d').astimezone(timezone(timedelta(hours=8))) + timedelta(
  54. days=30)).strftime('%Y-%m-%d')
  55. ymd_fortyfive_day = (datetime.strptime(ymd, '%Y-%m-%d').astimezone(timezone(timedelta(hours=8))) + timedelta(
  56. days=45)).strftime('%Y-%m-%d')
  57. ymd_sixty_day = (datetime.strptime(ymd, '%Y-%m-%d').astimezone(timezone(timedelta(hours=8))) + timedelta(
  58. days=60)).strftime('%Y-%m-%d')
  59. # timestamp
  60. timestamp_ymd = time.mktime(datatime_ymd)
  61. timestamp_tom = time.mktime(datatime_ymd_tom)
  62. # table_name
  63. table_name_login_today = table_name(datatime_ymd, datatime_realtime)
  64. table_name_login_tom = table_name(datatime_ymd_tom, datatime_realtime)
  65. table_name_login_tom_after = table_name(datatime_ymd_tom_after, datatime_realtime)
  66. table_name_login_seven_day = table_name(datatime_ymd_seven_day, datatime_realtime)
  67. table_name_login_fifteen_day = table_name(datatime_ymd_fifteen_day, datatime_realtime)
  68. table_name_login_thirty_day = table_name(datatime_ymd_thirty_day, datatime_realtime)
  69. table_name_login_fortyfive_day = table_name(datatime_ymd_fortyfive_day, datatime_realtime)
  70. table_name_login_sixty_day = table_name(datatime_ymd_sixty_day, datatime_realtime)
  71. sql = f"""
  72. select x.dt,x.channel,pitcher,stage,x.platform,x.book,
  73. ifnull(view_count,0),ifnull(click_count,0),
  74. ifnull(follow_user,0),ifnull(cost,0)/100 as cost,
  75. ifnull(web_view_count,0) web_view_count,
  76. ifnull(platform_view_count,0) platform_view_count,
  77. ifnull(web_order_count,0) web_order_count,
  78. if(stage ='趣程15期' or stage ='趣程26期' or stage ='趣程30期','GDT','MP') type
  79. ,0 require_roi,0 require_mult,
  80. ifnull(y.reg_num,0),ifnull(w.create_user_num,0),
  81. v.today_active_user_rate,
  82. v.second_stay_rate,
  83. v.third_stay_rate,
  84. v.seven_stay_rate,
  85. v.fifteen_stay_rate,
  86. v.thirty_stay_rate,
  87. v.fortyfive_stay_rate,
  88. v.sixty_stay_rate,
  89. v.game_user_sum
  90. from
  91. ( select dt, channel,stage,pitcher,platform,book from channel_info_daily cid
  92. where dt='{ymd}' and channel !=''
  93. and channel in
  94. (select distinct(channel) from channel_by_account_daily cbad
  95. where dt='{ymd}'
  96. and (type ='GDT' or type='MP')
  97. )
  98. ) x -- 只允许渠道MP、GDT
  99. left join
  100. (select channel,sum(cost) as cost,sum(view_count) as view_count,sum(valid_click_count) as click_count,
  101. sum(from_follow_uv) as follow_user,
  102. sum(web_view_count) as web_view_count,
  103. sum(platform_view_count) as platform_view_count,
  104. sum(web_order_count) as web_order_count
  105. from
  106. (select account_id,cost,view_count,valid_click_count,
  107. round(valid_click_count*official_account_follow_rate,0) as from_follow_uv,
  108. 0 as web_view_count,
  109. 0 as platform_view_count,
  110. 0 as web_order_count
  111. from daily_vx where date='{ymd} 00:00:00'
  112. union
  113. select account_id,cost,view_count,valid_click_count,from_follow_uv,
  114. ifnull(web_commodity_page_view_count,0) as web_view_count,
  115. ifnull(platform_page_view_count,0) as platform_view_count,
  116. ifnull(web_order_count,0) as web_order_count
  117. from daily_qq where date='{ymd} 00:00:00' ) a
  118. left join
  119. (select account_id,channel from channel_by_account_daily where dt='{ymd}') b
  120. on a.account_id=b.account_id group by channel)
  121. z on x.channel=z.channel
  122. left join
  123. (
  124. select h.name as channel ,DATE(FROM_UNIXTIME(origin.create_time)) as wx_date,
  125. count(*) as reg_num
  126. from
  127. db_mp.h_member origin left join
  128. (select a.name,d.app_id,d.agent_id from quchen_text.advertiser_vx a
  129. left join db_mp.h_game b on a.book = b.name
  130. left join db_mp.mp_mp_conf c on a.name= c.wx_name
  131. left join db_mp.mp_conf_agent d on c.id=d.advertiser_conf_id
  132. where d.app_id =b.id
  133. group by d.app_id ,d.agent_id ) h
  134. on origin.app_id = h.app_id and origin.agent_id = h.agent_id
  135. where h.name is not null
  136. and origin.create_time > {timestamp_ymd} and origin.create_time < {timestamp_tom}
  137. group by name,wx_date
  138. ) y on x.channel= y.channel
  139. left join
  140. (
  141. select h.name as channel,DATE(FROM_UNIXTIME(c.create_time)) as wx_date,
  142. count(*) as create_user_num
  143. from db_mp.h_mg_role a
  144. left join db_mp.h_mem_game b on a.mg_mem_id = b.id
  145. left join db_mp.h_member c on b.mem_id = c.id
  146. left join
  147. (select a.name,d.app_id,d.agent_id from quchen_text.advertiser_vx a
  148. left join db_mp.h_game b on a.book = b.name
  149. left join db_mp.mp_mp_conf c on a.name= c.wx_name
  150. left join db_mp.mp_conf_agent d on c.id=d.advertiser_conf_id
  151. where d.app_id =b.id
  152. group by d.app_id ,d.agent_id ) h
  153. on c.app_id = h.app_id and c.agent_id = h.agent_id
  154. where h.name is not null
  155. and c.create_time >= {timestamp_ymd} and c.create_time <= {timestamp_tom}
  156. group by h.name,wx_date
  157. order by wx_date desc
  158. ) w on x.channel= w.channel
  159. left join
  160. (
  161. select channel ,
  162. if(max(d_ct)=0,0,ifnull(max(e_ct),0)/max(d_ct)) as today_active_user_rate,
  163. if(sum(a_ct)=0,0,ifnull(sum(b_ct),0)/sum(a_ct)) as second_stay_rate,
  164. if(sum(a_ct)=0,0,ifnull(sum(c_ct),0)/sum(a_ct)) as third_stay_rate,
  165. if(sum(a_ct)=0,0,ifnull(sum(seven_ct),0)/sum(a_ct)) as seven_stay_rate,
  166. if(sum(a_ct)=0,0,ifnull(sum(fifteen_ct),0)/sum(a_ct)) as fifteen_stay_rate,
  167. if(sum(a_ct)=0,0,ifnull(sum(thirty_ct),0)/sum(a_ct)) as thirty_stay_rate,
  168. if(sum(a_ct)=0,0,ifnull(sum(fortyfive_ct),0)/sum(a_ct)) as fortyfive_stay_rate,
  169. if(sum(a_ct)=0,0,ifnull(sum(sixty_ct),0)/sum(a_ct)) as sixty_stay_rate,
  170. max(d_ct) game_user_sum from
  171. (select h.name as channel ,
  172. a.ct as a_ct,b.ct as b_ct,c.ct as c_ct,d.ct as d_ct,e.ct as e_ct,
  173. seven.ct as seven_ct,fifteen.ct as fifteen_ct,thirty.ct as thirty_ct,
  174. fortyfive.ct as fortyfive_ct,sixty.ct as sixty_ct
  175. from
  176. (select '{ymd}',a.app_id,a.agent_id,count(*) as ct from
  177. db_mp.h_member a
  178. left join (select distinct(mem_id) from db_mp.{table_name_login_today}
  179. where date = '{ymd}' ) b on a.id=b.mem_id
  180. where a.create_time >={timestamp_ymd} and a.create_time <={timestamp_tom}
  181. and b.mem_id is not null
  182. group by a.app_id ,a.agent_id ) a
  183. left join
  184. (select '{ymd}',a.app_id,a.agent_id,count(*) as ct from
  185. db_mp.h_member a
  186. left join (select distinct(mem_id) from db_mp.{table_name_login_tom}
  187. where date = '{ymd_tom}' ) b on a.id=b.mem_id
  188. where a.create_time >={timestamp_ymd} and a.create_time <={timestamp_tom}
  189. and b.mem_id is not null
  190. group by a.app_id ,a.agent_id ) b on a.app_id =b.app_id and a.agent_id =b.agent_id
  191. left join
  192. (select '{ymd}',a.app_id,a.agent_id,count(*) as ct from
  193. db_mp.h_member a
  194. left join (select distinct(mem_id) from db_mp.{table_name_login_tom_after}
  195. where date = '{ymd_tom_after}' ) b on a.id=b.mem_id
  196. where a.create_time >={timestamp_ymd} and a.create_time <={timestamp_tom}
  197. and b.mem_id is not null
  198. group by a.app_id ,a.agent_id ) c on a.app_id =c.app_id and a.agent_id = c.agent_id
  199. left join
  200. (select '{ymd}',a.app_id,a.agent_id,count(*) as ct from
  201. db_mp.h_member a
  202. left join (select distinct(mem_id) from db_mp.{table_name_login_seven_day}
  203. where date = '{ymd_seven_day}' ) b on a.id=b.mem_id
  204. where a.create_time >={timestamp_ymd} and a.create_time <={timestamp_tom}
  205. and b.mem_id is not null
  206. group by a.app_id ,a.agent_id ) seven on a.app_id =seven.app_id and a.agent_id = seven.agent_id
  207. left join
  208. (select '{ymd}',a.app_id,a.agent_id,count(*) as ct from
  209. db_mp.h_member a
  210. left join (select distinct(mem_id) from db_mp.{table_name_login_fifteen_day}
  211. where date = '{ymd_fifteen_day}' ) b on a.id=b.mem_id
  212. where a.create_time >={timestamp_ymd} and a.create_time <={timestamp_tom}
  213. and b.mem_id is not null
  214. group by a.app_id ,a.agent_id ) fifteen on a.app_id =fifteen.app_id and a.agent_id = fifteen.agent_id
  215. left join
  216. (select '{ymd}',a.app_id,a.agent_id,count(*) as ct from
  217. db_mp.h_member a
  218. left join (select distinct(mem_id) from db_mp.{table_name_login_thirty_day}
  219. where date = '{ymd_thirty_day}' ) b on a.id=b.mem_id
  220. where a.create_time >={timestamp_ymd} and a.create_time <={timestamp_tom}
  221. and b.mem_id is not null
  222. group by a.app_id ,a.agent_id ) thirty on a.app_id =thirty.app_id and a.agent_id = thirty.agent_id
  223. left join
  224. (select '{ymd}',a.app_id,a.agent_id,count(*) as ct from
  225. db_mp.h_member a
  226. left join (select distinct(mem_id) from db_mp.{table_name_login_fortyfive_day}
  227. where date = '{ymd_fortyfive_day}' ) b on a.id=b.mem_id
  228. where a.create_time >={timestamp_ymd} and a.create_time <={timestamp_tom}
  229. and b.mem_id is not null
  230. group by a.app_id ,a.agent_id ) fortyfive on a.app_id =fortyfive.app_id and a.agent_id = fortyfive.agent_id
  231. left join
  232. (select '{ymd}',a.app_id,a.agent_id,count(*) as ct from
  233. db_mp.h_member a
  234. left join (select distinct(mem_id) from db_mp.{table_name_login_sixty_day}
  235. where date = '{ymd_sixty_day}' ) b on a.id=b.mem_id
  236. where a.create_time >={timestamp_ymd} and a.create_time <={timestamp_tom}
  237. and b.mem_id is not null
  238. group by a.app_id ,a.agent_id ) sixty on a.app_id =sixty.app_id and a.agent_id = sixty.agent_id
  239. left join
  240. (select app_id ,count(*) as ct from db_mp.h_member hm
  241. where create_time <={timestamp_tom}
  242. group by app_id ) d on a.app_id =d.app_id
  243. left join
  244. (select count(distinct(mem_id)) as ct,app_id from db_mp.{table_name_login_today}
  245. where date = '{ymd}'
  246. group by app_id ) e on a.app_id =e.app_id
  247. left join
  248. (select a.name as name,d.app_id as app_id ,d.agent_id as agent_id
  249. from quchen_text.advertiser_vx a
  250. left join db_mp.h_game b on a.book = b.name
  251. left join db_mp.mp_mp_conf c on a.name= c.wx_name
  252. left join db_mp.mp_conf_agent d on c.id=d.advertiser_conf_id
  253. where d.app_id =b.id
  254. group by d.app_id ,d.agent_id) h on a.app_id = h.app_id and a.agent_id = h.agent_id
  255. where h.name is not null) as keep_data
  256. group by channel)
  257. v on x.channel= v.channel
  258. """
  259. print(sql)
  260. data = db.quchen_text.get_data_list(sql)
  261. data1 = []
  262. col = "dt,channel,pitcher,stage,platform,book,view_count,click_count,follow_user,cost,web_view_count,platform_view_count,web_order_count,type,require_roi,require_mult,reg_num,create_user_num,today_active_user_rate,second_stay_rate,third_stay_rate,seven_stay_rate,fifteen_stay_rate,thirty_stay_rate,fortyfive_stay_rate,sixty_stay_rate,game_user_sum"
  263. for i in data:
  264. i[0] = str(i[0])
  265. i[9] = str(i[9])
  266. i[6] = float(i[6])
  267. i[7] = float(i[7])
  268. i[8] = float(i[8])
  269. i[9] = float(i[9])
  270. i[10] = float(i[10])
  271. i[11] = float(i[11])
  272. i[12] = float(i[12])
  273. i[18] = float(i[18]) if i[18] else 0
  274. i[19] = float(i[19]) if i[19] else 0
  275. i[20] = float(i[20]) if i[20] else 0
  276. i[21] = float(i[21]) if i[21] else 0
  277. i[22] = float(i[22]) if i[22] else 0
  278. i[23] = float(i[23]) if i[23] else 0
  279. i[24] = float(i[24]) if i[24] else 0
  280. i[25] = float(i[25]) if i[25] else 0
  281. i[26] = float(i[26]) if i[26] else 0
  282. data1.append(tuple(i))
  283. for _ in data1:
  284. print(_)
  285. ck.execute(f"alter table game_data.dw_daily_channel_cost drop partition '{ymd}' ")
  286. logging.info(len(data1))
  287. ck.insertMany("game_data.dw_daily_channel_cost", col, tuple(data1))
  288. def channel_by_account_daily(ymd):
  289. """返回当天消耗账户对应的公众号表"""
  290. logging.info("run> channel_by_account_daily")
  291. sql = """replace into channel_by_account_daily
  292. select '{0}' as dt,a.account_id as account_id, ifnull(ifnull(b.name,a.name),'') as channel,type from
  293. (select account_id,name,'GDT' type from advertiser_qq
  294. union
  295. select account_id,name,'MP' type from advertiser_vx
  296. union
  297. select advertiser_id,channel,'BYTEDANCE' type from advertiser_bytedance
  298. ) a
  299. left join
  300. (select b.account_id,b.name from
  301. (select min(end_time) as end_time,account_id from account_change where end_time>'{0}' GROUP BY account_id) a
  302. left join account_change b on a.end_time=b.end_time and a.account_id=b.account_id) b on a.account_id=b.account_id""".format(
  303. ymd)
  304. db.quchen_text.execute(sql)
  305. def channel_info_daily(ymd):
  306. """获取公众号某天的期数,投手,平台,书籍
  307. @ return [[]]
  308. """
  309. # 获取现在的全量公众号信息
  310. logging.info("run> channel_info_daily")
  311. sql = f"""select '{ymd}' as dt,a.name ,ifnull(stage,''),ifnull(pitcher,''),ifnull(platform,''),ifnull(book,'') from (
  312. select name from advertiser_vx where name is not null group by name-- 公众号全量表
  313. union
  314. select name from account_change group by name
  315. union
  316. select channel as name from pitcher_change group by channel
  317. union
  318. select name from platform_change group by name
  319. union
  320. select name from book_change group by name) a
  321. left join
  322. ( select name,ifnull(stage,'') stage,ifnull(pitcher,'') pitcher,
  323. ifnull(platform,'') platform,ifnull(book,'') book
  324. from advertiser_vx
  325. where name is not null
  326. and start_date <= '{ymd}'
  327. and if(end_date is null,1,end_date >= '{ymd}')
  328. group by name,stage,pitcher,platform,book
  329. ) b on a.name=b.name
  330. """
  331. data = db.quchen_text.get_data_list(sql)
  332. pitcher_change = db.quchen_text.getData(
  333. "select b.channel as channel,pitcher from "
  334. "(select max(start_time) as start_time,channel from pitcher_change "
  335. " where start_time<='{}' GROUP BY channel) a"
  336. " left join pitcher_change b on a.start_time=b.start_time and a.channel=b.channel".format(ymd))
  337. platform_change = db.quchen_text.getData(
  338. "select b.name as channel,current_platform as platform from (select max(change_date) as change_date,name from platform_change "
  339. "where change_date<='{}' GROUP BY name) a "
  340. "left join platform_change b on a.change_date=b.change_date and a.name=b.name".format(ymd))
  341. book_change = db.quchen_text.getData(
  342. "select b.name as channel,book from (select max(start_time) as start_time,name from book_change "
  343. "where start_time<='{}' GROUP BY name) a "
  344. "left join book_change b on a.start_time=b.start_time and a.name=b.name".format(ymd))
  345. stage_change = db.quchen_text.getData(
  346. "select channel,stage from (select max(start_date) as start_date,channel from stage_change "
  347. "where start_date<='{}' GROUP BY channel) a "
  348. "left join stage_change using(start_date,channel)".format(ymd))
  349. for i in data:
  350. for j in pitcher_change:
  351. if i[1] == j[0]:
  352. i[3] = j[1]
  353. for k in platform_change:
  354. if i[1] == k[0]:
  355. i[4] = k[1]
  356. for h in book_change:
  357. if i[1] == h[0]:
  358. i[5] = h[1]
  359. for m in stage_change:
  360. if i[1] == m[0]:
  361. i[2] = m[1]
  362. insert_sql = "replace into channel_info_daily values (%s,%s,%s,%s,%s,%s) "
  363. db.quchen_text.executeMany(insert_sql, data)
  364. def ods_order(dt):
  365. sql = """ replace into ods_order
  366. select
  367. case platform when '掌中云' then DATE_FORMAT(STR_TO_DATE(order_time,'%Y-%m-%dT%H:%i:%s'),'%Y-%m-%d')
  368. when '掌读' then from_unixtime(order_time, '%Y-%m-%d')
  369. ELSE order_time end date,
  370. stage,platform,channel,channel_id,user_id,
  371. case when platform='掌中云' then DATE_FORMAT(STR_TO_DATE(order_time,'%Y-%m-%dT%H:%i:%s'),'%Y-%m-%d %H:%i:%s')
  372. when platform='掌读' then from_unixtime(order_time, '%Y-%m-%d %H:%i:%s')
  373. ELSE order_time end order_time,
  374. case when platform='掌中云' then DATE_FORMAT(STR_TO_DATE(reg_time,'%Y-%m-%dT%H:%i:%s'),'%Y-%m-%d %H:%i:%s')
  375. when platform='掌读' then from_unixtime(reg_time, '%Y-%m-%d %H:%i:%s')
  376. ELSE reg_time end reg_time,
  377. amount,from_novel,order_id,2 from `order` where date=UNIX_TIMESTAMP('{}')
  378. """.format(dt)
  379. db.quchen_text.execute(sql)
  380. def order_account_text():
  381. db.quchen_text.execute("truncate order_account_text")
  382. with open('./wending_account_config.csv', encoding='utf-8') as f:
  383. for i in f.readlines():
  384. db.quchen_text.execute("insert into order_account_text(platform,text) values ('文鼎','{}')".format(i))
  385. if __name__ == '__main__':
  386. # channel_info_daily('2021-02-06')
  387. # dw_daily_channel_cost('2021-10-11')
  388. # exit()
  389. # channel_by_account_daily('2021-02-05')
  390. for i in dt.getDateLists('2021-09-08', '2021-11-13'):
  391. print(i)
  392. channel_by_account_daily(i)
  393. channel_info_daily(i)
  394. dw_daily_channel_cost(i)
  395. # ods_order('2021-05-06')
  396. platform_data_sum(i)