|
@@ -38,7 +38,7 @@ from dw_channel where 1=1 {op1} {op2} {op3} {op5} {op6} GROUP BY channel,book,pi
|
|
def book_trend(start,end,book,type,platform,page,page_size,order_by,order):
|
|
def book_trend(start,end,book,type,platform,page,page_size,order_by,order):
|
|
op1 = f" and book='{book}'" if book else ''
|
|
op1 = f" and book='{book}'" if book else ''
|
|
op2 = f" and type='{type}' " if type else ''
|
|
op2 = f" and type='{type}' " if type else ''
|
|
- op3 = f" and platform='{platform}' " if platform else ''
|
|
|
|
|
|
+ # op3 = f" and platform='{platform}' " if platform else ''
|
|
op4 = f" and dt>='{start}' " if start else ''
|
|
op4 = f" and dt>='{start}' " if start else ''
|
|
op5 = f" and dt<='{end}' " if end else ''
|
|
op5 = f" and dt<='{end}' " if end else ''
|
|
op6 = f" order by {order_by} {order}" if order_by and order else ''
|
|
op6 = f" order by {order_by} {order}" if order_by and order else ''
|
|
@@ -277,7 +277,7 @@ concat(sum(a60-a59),',',sum(a60-a59)/sum(cost),',',sum(a60)/sum(cost),',',sum(a6
|
|
concat(sum(m3-a60),',',sum(m3-a60)/sum(cost),',',sum(m3)/sum(cost),',',sum(m3)/sum(a1)) m3,
|
|
concat(sum(m3-a60),',',sum(m3-a60)/sum(cost),',',sum(m3)/sum(cost),',',sum(m3)/sum(a1)) m3,
|
|
concat(sum(m4-m3),',',sum(m4-m3)/sum(cost),',',sum(m4)/sum(cost),',',sum(m4)/sum(a1)) m4,
|
|
concat(sum(m4-m3),',',sum(m4-m3)/sum(cost),',',sum(m4)/sum(cost),',',sum(m4)/sum(a1)) m4,
|
|
concat(sum(m5-m4),',',sum(m5-m4)/sum(cost),',',sum(m5)/sum(cost),',',sum(m5)/sum(a1)) m5
|
|
concat(sum(m5-m4),',',sum(m5-m4)/sum(cost),',',sum(m5)/sum(cost),',',sum(m5)/sum(a1)) m5
|
|
- from book_trend where cost>0 {op1} {op2} {op4} group by book,type {op5}
|
|
|
|
|
|
+ from book_trend where cost>0 {op1} {op2} {op3} {op4} group by book,type {op5}
|
|
"""
|
|
"""
|
|
data, total = getLimitData(db.dm, sql, page, page_size)
|
|
data, total = getLimitData(db.dm, sql, page, page_size)
|
|
|
|
|