Commit 764c8b08 by wujicang

Update self_asin_redis.py

parent 5f5be0b7
...@@ -168,7 +168,11 @@ def export(): ...@@ -168,7 +168,11 @@ def export():
img_num, img_num,
date_format(updated_at, '%Y-%m-%d %H:%m:%S') updated_at, date_format(updated_at, '%Y-%m-%d %H:%m:%S') updated_at,
date_format(online_time, '%Y-%m-%d %H:%m:%S') online_time, date_format(online_time, '%Y-%m-%d %H:%m:%S') online_time,
coalesce(if(returns = 'Customers usually keep this item', 1, 0), 0) as is_high_return_rate case
when returns = 'Customers usually keep this item' then 1
when returns = 'Frequently returned item' then 2
else 0
end as is_high_return_rate
from {site_name}_self_asin_detail from {site_name}_self_asin_detail
where updated_at >= '{last_day}' where updated_at >= '{last_day}'
and updated_at <= '{next_day}' and updated_at <= '{next_day}'
...@@ -301,7 +305,11 @@ def export_all(): ...@@ -301,7 +305,11 @@ def export_all():
img_num, img_num,
date_format(updated_at, '%Y-%m-%d %H:%m:%S') updated_at, date_format(updated_at, '%Y-%m-%d %H:%m:%S') updated_at,
date_format(online_time, '%Y-%m-%d %H:%m:%S') online_time, date_format(online_time, '%Y-%m-%d %H:%m:%S') online_time,
coalesce(if(returns = 'Customers usually keep this item', 1, 0), 0) as is_high_return_rate case
when returns = 'Customers usually keep this item' then 1
when returns = 'Frequently returned item' then 2
else 0
end as is_high_return_rate
from ( from (
select max(id) as max_id select max(id) as max_id
from {site_name}_self_asin_detail from {site_name}_self_asin_detail
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment