|
@@ -46,7 +46,7 @@ def book_trend(start,end,book,type,platform,page,page_size,order_by,order):
|
|
|
db=MysqlUtils()
|
|
|
|
|
|
sql=f"""
|
|
|
- select dt,book,type,platform,cost,first_order_amount,reg_order_amount,
|
|
|
+ select dt,book,type,cost,first_order_amount,reg_order_amount,
|
|
|
round(first_order_amount/cost,4) first_roi,
|
|
|
a7,a30,
|
|
|
round(a7/cost,4) roi7,
|
|
@@ -155,8 +155,8 @@ round(sum(cost)/sum(first_order_user)) first_order_cost
|
|
|
from ({sql}) a
|
|
|
"""
|
|
|
|
|
|
- data,total,total_data=getLimitSumData(db.dm,sql,sum_sql,page,page_size)
|
|
|
-
|
|
|
+ data, total, total_data = getLimitSumData(db.dm, sql, sum_sql, page, page_size)
|
|
|
+
|
|
|
def parse(str):
|
|
|
li=str.split(',')
|
|
|
li[0]=round(float(li[0]),2)
|
|
@@ -173,5 +173,5 @@ from ({sql}) a
|
|
|
'd60','m3','m4','m5']:
|
|
|
i[k]= parse(v) if v else {}
|
|
|
|
|
|
- return data,total,total_data
|
|
|
+ return data, total, total_data
|
|
|
|