|
@@ -26,6 +26,9 @@ def get_channels_from_user(user):
|
|
|
|
|
|
def get_pitcher_panel_channel(pitcher,channel,start,end,page,page_size,order_by,order):
|
|
def get_pitcher_panel_channel(pitcher,channel,start,end,page,page_size,order_by,order):
|
|
db=MysqlUtils()
|
|
db=MysqlUtils()
|
|
|
|
+ op1=f" and pitcher='{pitcher}'" if pitcher else ''
|
|
|
|
+ op2=f" and channel='{channel}'" if channel else ''
|
|
|
|
+
|
|
sql=f"""select channel,stage,platform,book,
|
|
sql=f"""select channel,stage,platform,book,
|
|
dt as date,cost,first_order_amount,
|
|
dt as date,cost,first_order_amount,
|
|
if(cost=0,0,first_order_amount/cost) first_roi,
|
|
if(cost=0,0,first_order_amount/cost) first_roi,
|
|
@@ -36,15 +39,9 @@ def get_pitcher_panel_channel(pitcher,channel,start,end,page,page_size,order_by,
|
|
if(follow_user=0,0,cost/follow_user) follow_per_cost,
|
|
if(follow_user=0,0,cost/follow_user) follow_per_cost,
|
|
total_cost,
|
|
total_cost,
|
|
if(total_cost=0,0,total_amount/total_cost) back_rate
|
|
if(total_cost=0,0,total_amount/total_cost) back_rate
|
|
- from dw_channel_daily where dt>='{start}' and dt<='{end}' """
|
|
|
|
- if pitcher!='all':
|
|
|
|
- sql += f" and pitcher='{pitcher}' "
|
|
|
|
-
|
|
|
|
- if channel!='':
|
|
|
|
- sql += f" and channel='{channel}' "
|
|
|
|
-
|
|
|
|
- sql += f" order by {order_by} {order}"
|
|
|
|
-
|
|
|
|
|
|
+ from dw_channel_daily where dt>='{start}' and dt<='{end}' {op1} {op2}
|
|
|
|
+ order by {order_by} {order}
|
|
|
|
+"""
|
|
return getLimitData(db.quchen_text,sql,page,page_size)
|
|
return getLimitData(db.quchen_text,sql,page,page_size)
|
|
|
|
|
|
|
|
|