|
@@ -385,9 +385,28 @@ def boss_panel_summary(start,end,pitcher, type, stage, page, page_size, order_by
|
|
|
|
|
|
dm = MysqlUtils().dm
|
|
|
|
|
|
- sql=f"""select sum(order_amount) order_amount,sum(cost) cost,dt from dw_channel
|
|
|
+ sql=f"""select sum(order_amount) order_amount,sum(cost) cost,dt from dw_channel
|
|
|
where 1=1 {op1} {op2} {op3} {op4} {op5}
|
|
|
GROUP BY dt HAVING order_amount+cost>0 {op6} """
|
|
|
# print(sql)
|
|
|
|
|
|
- return getLimitData(dm, sql, page, page_size)
|
|
|
+ return getLimitData(dm, sql, page, page_size)
|
|
|
+
|
|
|
+
|
|
|
+def image_rank(start, end, type,book, page, page_size, order_by, order):
|
|
|
+ op1 = f" and book='{book}' " if book else ''
|
|
|
+ op2 = f" and dt>='{start}' " if start else ''
|
|
|
+ op3 = f" and dt<='{end}' " if end else ''
|
|
|
+ op4 = f" and type='{type}' " if type else ''
|
|
|
+ op5 = f" order by {order_by} {order}" if order_by and order else 'order by dt desc'
|
|
|
+
|
|
|
+ db = MysqlUtils().quchen_text
|
|
|
+
|
|
|
+ sql =f"""select image_id,preview_url,
|
|
|
+ sum(cost),
|
|
|
+ round(sum(click_count)/sum(view_count),4) ctr,
|
|
|
+ round(sum(cost)/sum(click_count),2) cpc
|
|
|
+ from dm_image_cost_day where 1=1 {op1} {op2} {op3} {op4} GROUP BY image_id,preview_url
|
|
|
+ {op5} """
|
|
|
+
|
|
|
+ return getLimitData(db, sql, page, page_size)
|