|
@@ -14,12 +14,13 @@ def order_sync_ck(ymd):
|
|
|
col = "date,stage,platform,channel,channel_id,user_id,order_time,reg_time,amount,from_novel,order_id"
|
|
|
sql ="select * from ods_order where date='{}'".format(ymd)
|
|
|
data = db.quchen_text.getData(sql)
|
|
|
+
|
|
|
data1 = []
|
|
|
for x in data:
|
|
|
li = list(x)
|
|
|
|
|
|
li[0]=str(li[0])
|
|
|
- li[3]='' if li[3]==None else li[3]
|
|
|
+ li[3]='' if li[3]==None else li[3].replace(' ','')
|
|
|
li[5]='' if li[5]==None else li[5]
|
|
|
li[6]=str(li[6])
|
|
|
li[7]='0000-00-00 00:00:00' if li[7]==None else str(li[7])
|
|
@@ -27,6 +28,7 @@ def order_sync_ck(ymd):
|
|
|
|
|
|
data1.append(tuple(li))
|
|
|
|
|
|
+
|
|
|
# 删除分区
|
|
|
ck.execute("alter table order drop partition '{}' ".format(ymd))
|
|
|
ck.insertMany("order", col, tuple(data1))
|
|
@@ -84,7 +86,7 @@ def dw_order_channel_cost_sync_ck(ymd):
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
- order_sync_ck('2020-12-23')
|
|
|
+ order_sync_ck('2020-11-03')
|
|
|
# dw_order_channel_cost_sync_ck(dt.get_n_days(-2))
|
|
|
# for i in dt.getDateLists('2019-03-18','2020-12-17'):
|
|
|
# # order(i)
|