ck 4 years ago
parent
commit
97c5f42655
1 changed files with 2 additions and 2 deletions
  1. 2 2
      data_manage/public_analysis.py

+ 2 - 2
data_manage/public_analysis.py

@@ -195,8 +195,8 @@ def book_overview(start, end, book, type, page, page_size, order_by, order):
                 sum(first_order_amount) first_amount,
                 round(sum(reg_order_amount)/sum(cost),4) roi,
                 round(sum(first_order_amount)/sum(cost),4) first_roi,
-                round(sum(a7)/sum(cost),4) roi7,
-                round(sum(a30)/sum(cost),4) roi30,
+                round(sum(a7)/sum(if(dt>=SUBDATE(CURRENT_DATE,INTERVAL 5 day),0,cost)),4) roi7,
+                round(sum(a30)/sum(if(dt>=SUBDATE(CURRENT_DATE,INTERVAL 28 day),0,cost)),4) roi30,
                 sum(reg_order_amount-cost) profit,
     round(sum(click_count)/sum(view_count),4) click_rate,
     round(sum(follow_user)/sum(click_count),4) follow_rate,