Commit a382ecac by lizefeng

优化无库仓销量算法

parent 078077ba
......@@ -387,7 +387,7 @@ Truncate table dc_not_stock_goods_sales_temp;
INSERT into dc_not_stock_goods_sales_temp(`product_inner_code`,`warehouse_code`,`test_sales`,`success_sales`) (
select
t2.product_inner_code,t1.warehouse_code,
sum(case when TIMESTAMPDIFF(day,t2.push_time,now())<21 then t1.bailun_sku_quantity_ordered else 0 end) as 'test_sales', -- 推送之后 21 日的销量
sum(case when TIMESTAMPDIFF(day,t2.push_time,t1.pay_time)<21 then t1.bailun_sku_quantity_ordered else 0 end) as 'test_sales', -- 推送之后 21 日的销量
sum(case when TIMESTAMPDIFF(day,t1.pay_time,now())<7 then t1.bailun_sku_quantity_ordered else 0 end) as 'success_sales' -- 最近7日销量
from dc_base_oms_sku as t1
left join dc_base_sku as t2 on t1.bailun_sku = t2.bailun_sku
......
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