|
@@ -22,13 +22,13 @@ select
|
|
|
channel_count-on_channel_count off_channel_count,
|
|
|
this_month_cost,
|
|
|
this_month_amount,
|
|
|
- if(this_month_cost = 0, 0, round(this_month_amount / this_month_cost, 4)) this_month_roi,
|
|
|
+ if(this_month_cost < 1, 0, round(this_month_amount / this_month_cost, 4)) this_month_roi,
|
|
|
last_month_cost,
|
|
|
last_month_amount,
|
|
|
- if(last_month_cost = 0, 0, last_month_amount / last_month_cost) last_month_roi,
|
|
|
+ if(last_month_cost < 1, 0, last_month_amount / last_month_cost) last_month_roi,
|
|
|
last_month_far_amount,
|
|
|
follow_user,
|
|
|
- if(last_month_cost = 0, 0, last_month_far_amount / last_month_cost) last_month_far_roi
|
|
|
+ if(last_month_cost < 1, 0, last_month_far_amount / last_month_cost) last_month_far_roi
|
|
|
from (select pitcher,
|
|
|
sum(follow_user) follow_user
|
|
|
from dw_daily_channel_cost
|
|
@@ -84,7 +84,6 @@ left outer join (
|
|
|
) g on q.pitcher=g.pitcher
|
|
|
"""
|
|
|
data = ck.execute(sql)
|
|
|
- # print(data)
|
|
|
db.dm.executeMany("replace into dm_pitcher_daily_overview values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)", data)
|
|
|
logging.info('投手累计数据处理,结束')
|
|
|
|