|
@@ -140,10 +140,7 @@ def get_channel_overview(channel,pitcher,start,end,page,page_size,order_by,order
|
|
|
round(if(first_order_user=0,0,cost/first_order_user),2) first_cost_per_user,
|
|
|
round(if(follow_user=0,0,first_order_user/follow_user),4) new_user_order_rate,
|
|
|
reg_order_amount,
|
|
|
--- total_cost,
|
|
|
--- total_amount,
|
|
|
round(if(cost=0,0,first_order_amount/cost),4) day_roi,
|
|
|
--- round(if(total_cost=0,0,total_amount/total_cost),4) all_roi,
|
|
|
round(order_amount/cost,4) roi,
|
|
|
round(if(total_cost=0,0,total_first_amount/total_cost),4) avg_new_order_rate,
|
|
|
round(if(reg_order_user=0,0,reg_order_user_again/reg_order_user),4) old_user_once_order_rate,
|
|
@@ -707,16 +704,14 @@ from order where dt>='{start}' {channel_op} group by formatDateTime(reg_time,'
|
|
|
count= len(data)
|
|
|
if count==0:
|
|
|
return [],0
|
|
|
- di={'cost':round(cost,2),'reg_amount':round(reg_amount,2),'roi':round(reg_amount/cost,4), 'new_follow_user':new_follow_user,
|
|
|
+ total_data={'cost':round(cost,2),'reg_amount':round(reg_amount,2),'roi':round(reg_amount/cost,4), 'new_follow_user':new_follow_user,
|
|
|
'new_follow_per_cost':round(new_follow_per_cost/count,2),'order_user':order_user,'order_count':order_count,
|
|
|
'order_user_per_cost':round(order_user_per_cost/count,2),'channel':'-','date':'总计','book':'-'
|
|
|
}
|
|
|
- data.reverse()
|
|
|
- data.append(di)
|
|
|
- data.reverse()
|
|
|
- # print(data)
|
|
|
|
|
|
- return data,total
|
|
|
+
|
|
|
+
|
|
|
+ return data,total,total_data
|
|
|
|
|
|
def get_channel_summary(channel,pitcher,page,page_size,order_by,order,state,location,start,end):
|
|
|
db=MysqlUtils()
|
|
@@ -835,7 +830,7 @@ def get_pitcher_trend(pitcher,start=None,end=None,page=None,page_size=None,order
|
|
|
from ({sql}) a
|
|
|
"""
|
|
|
|
|
|
- data,total=getLimitSumData(db.quchen_text,sql,sumSql,page,page_size)
|
|
|
+ data,total,total_data=getLimitSumData(db.quchen_text,sql,sumSql,page,page_size)
|
|
|
print(data)
|
|
|
def parse(str):
|
|
|
li=str.split(',')
|
|
@@ -850,7 +845,7 @@ def get_pitcher_trend(pitcher,start=None,end=None,page=None,page_size=None,order
|
|
|
'd11','d12','d13','d14','d15','d16','d17','d18','d19','d20','d21','d22','d23','d24','d25','d26','d27','d28','d29','d30']:
|
|
|
i[k]= parse(v) if i["cost"]!=0 else {}
|
|
|
|
|
|
- return data,total
|
|
|
+ return data,total,total_data
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|