@@ -489,10 +489,10 @@ left join dc_base_stock as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_
...
@@ -489,10 +489,10 @@ left join dc_base_stock as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_
where
where
t1.warehouse_code in ('GZBLWH', 'QYBLZZ')
t1.warehouse_code in ('GZBLWH', 'QYBLZZ')
and t1.bailun_sku not in ('942904501')
and t1.bailun_sku not in ('942904501')
and ( t2.buyer_name not in ('张莹霞','张莹霞1','赵美聪','黄镜洁','赵美聪','赵美聪1','秦振荣') or t2.`status`=1 )
and ( t2.buyer_name not in ('张莹霞','张莹霞1','赵美聪','黄镜洁','赵美聪','赵美聪1','秦振荣','李华娟','赵美聪-独立站') or t2.`status`=1 )
and ( t1.quantity_purchase<=0 and (ifnull(t4.sum_unshipped_quantity,0) - ifnull(t3.sum_usable_stock,0))>0 ) -- 有缺货
and ( t1.quantity_purchase<=0 and (ifnull(t4.sum_unshipped_quantity,0) - ifnull(t3.sum_usable_stock,0))>0 ) -- 有缺货
and (ifnull(t4.sum_unshipped_quantity,0) - ifnull(t3.sum_usable_stock,0))>0 -- 有缺货
and (ifnull(t4.sum_unshipped_quantity,0) - ifnull(t3.sum_usable_stock,0))>0 -- 有缺货
and ( ifnull(t4.sum_quantity_purchase,0)<=0 or t2.buyer_name in ('张莹霞','张莹霞1','赵美聪','黄镜洁','赵美聪','赵美聪1','秦振荣')
) -- 无在途 或者 自产 (自产的有在途也要推)
and ( ifnull(t4.sum_quantity_purchase,0)<=0 or t2.buyer_name in ('张莹霞','张莹霞1','赵美聪','黄镜洁','赵美聪','赵美聪1','秦振荣','李华娟','赵美聪-独立站')
) -- 无在途 或者 自产 (自产的有在途也要推)
and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_shortage_push_not_config.warehouse_code=t1.warehouse_code and dc_auto_shortage_push_not_config.bailun_sku=t1.bailun_sku )
and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_shortage_push_not_config.warehouse_code=t1.warehouse_code and dc_auto_shortage_push_not_config.bailun_sku=t1.bailun_sku )
";
";
if(!is_all)
if(!is_all)
...
@@ -528,9 +528,9 @@ left join (
...
@@ -528,9 +528,9 @@ left join (
where t1.usable_stock<=0 and t1.bailun_sku!=''
where t1.usable_stock<=0 and t1.bailun_sku!=''
and t1.warehouse_code in ('GZBLWH', 'QYBLZZ')
and t1.warehouse_code in ('GZBLWH', 'QYBLZZ')
and t1.bailun_sku not in ('942904501')
and t1.bailun_sku not in ('942904501')
and ( t3.buyer_name not in ('张莹霞','张莹霞1','赵美聪','黄镜洁','赵美聪','赵美聪1','秦振荣') or t3.`status`=1 )
and ( t3.buyer_name not in ('张莹霞','张莹霞1','赵美聪','黄镜洁','赵美聪','赵美聪1','秦振荣','李华娟','赵美聪-独立站') or t3.`status`=1 )
and IFNULL(t4.sum_usable_stock,0)<=0 -- 无库存
and IFNULL(t4.sum_usable_stock,0)<=0 -- 无库存
and ( ifnull(t5.sum_quantity_purchase,0)<=0 or t3.buyer_name in ('张莹霞','张莹霞1','赵美聪','黄镜洁','赵美聪','赵美聪1','秦振荣')
and ( ifnull(t5.sum_quantity_purchase,0)<=0 or t3.buyer_name in ('张莹霞','张莹霞1','赵美聪','黄镜洁','赵美聪','赵美聪1','秦振荣','李华娟','赵美聪-独立站')
) -- 无在途 或者 自产 (自产的有在途也要推)
) -- 无在途 或者 自产 (自产的有在途也要推)
and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_shortage_push_not_config.warehouse_code=t1.warehouse_code and dc_auto_shortage_push_not_config.bailun_sku=t1.bailun_sku )
and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_shortage_push_not_config.warehouse_code=t1.warehouse_code and dc_auto_shortage_push_not_config.bailun_sku=t1.bailun_sku )