renyupeng пре 9 месеци
родитељ
комит
e3a25b7577
2 измењених фајлова са 5 додато и 5 уклоњено
  1. 3 3
      ETL/KuaishouRuleOrderDataTherad.py
  2. 2 2
      ETL/PromoterOrderAmountThread.py

+ 3 - 3
ETL/KuaishouRuleOrderDataTherad.py

@@ -64,7 +64,7 @@ group by promoter_id
                        count(distinct case when order_status!=80 then oid  end) as valid_order_num
                   from {database}.kuaishou_supply_chain
                   where stat_date <= {stat_date}
-                    and promoter_id = {promoter_id}
+                    and promoter_id = '{promoter_id}'
                   group by promoter_id, item_id) a
                      left join
                  (select item_id,
@@ -77,7 +77,7 @@ group by promoter_id
                          collect_sample_name,
                          create_time
                   from {database}.kuaishou_item_collect_samples
-                  where promoter_id = {promoter_id}) b
+                  where promoter_id = '{promoter_id}') b
                  on a.promoter_id = b.promoter_id and a.item_id = b.item_id
                      left join (select item_id, relate_id, user_id, user_name, item_title
                                 from {database}.kuaishou_item_list
@@ -89,7 +89,7 @@ group by promoter_id
                        count(distinct case when order_status!=80 then oid  end) as valid_order_num
                   from {database}.kuaishou_supply_chain
                   where stat_date <= date_format(date_sub('{stat_date}', interval 1 day), '%Y%m%d')
-                    and promoter_id = {promoter_id}
+                    and promoter_id = '{promoter_id}'
                   group by promoter_id, item_id) e
                                on a.promoter_id = e.promoter_id and a.item_id = e.item_id
                         """.format(stat_date=self.stat_date, promoter_id=promoter_id,database=database)

+ 2 - 2
ETL/PromoterOrderAmountThread.py

@@ -46,13 +46,13 @@ a.promoter_id, valid_order_num, valid_amount,b.30day_order_num,b.30day_gmv
 from
 (select promoter_id, count(distinct oid) as valid_order_num, sum(order_amount) as valid_amount
 from {database}.kuaishou_supply_chain
-where order_status != 80 and promoter_id={promoter_id}
+where order_status != 80 and promoter_id='{promoter_id}'
 group by promoter_id)a
 left join (
   select promoter_id, count(distinct oid) 30day_order_num, sum(order_amount) as 30day_gmv
 from {database}.kuaishou_supply_chain
 where order_status != 80 and stat_date>date_format(date_sub('{stat_date}',interval 30 day),'%Y%m%d')
- and promoter_id={promoter_id}
+ and promoter_id='{promoter_id}'
 group by promoter_id
     )b
 on a.promoter_id=b.promoter_id;