left join dc_base_stock as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
left join dc_base_stock as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
left join dc_auto_config_sku_warehouse as t6 on t1.bailun_sku = t6.bailun_sku and t1.warehouse_code = t6.warehouse_code
left join dc_auto_config_sku_warehouse as t6 on t1.bailun_sku = t6.bailun_sku and t1.warehouse_code = t6.warehouse_code
where
where
( t1.warehouse_code in ('GZBLWH', 'QYBLZZ','BLGZ03') or ( t1.warehouse_code in ('YWWH01') or t2.`status`=1 or t6.`status`=1 ) ) -- 义务仓 只要停止监控 或者停售就推送
( t1.warehouse_code in ('GZBLWH', 'QYBLZZ','BLGZ03') or ( t1.warehouse_code in ('YWWH01') and ( t2.`status`=1 or t6.`status`=1 ) ) ) -- 义务仓 只要停止监控 或者停售就推送
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 ) -- 有缺货
...
@@ -530,7 +530,7 @@ left join (
...
@@ -530,7 +530,7 @@ left join (
) as t5 on t1.bailun_sku = t5.bailun_sku and t_db.area_id = t5.area_id
) as t5 on t1.bailun_sku = t5.bailun_sku and t_db.area_id = t5.area_id
left join dc_auto_config_sku_warehouse as t6 on t1.bailun_sku = t6.bailun_sku and t1.warehouse_code = t6.warehouse_code
left join dc_auto_config_sku_warehouse as t6 on t1.bailun_sku = t6.bailun_sku and t1.warehouse_code = t6.warehouse_code
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','BLGZ03') or ( t1.warehouse_code in ('YWWH01') or t3.`status`=1 or t6.`status`=1 ) ) -- 义务仓 只要停止监控 或者停售就推送
and ( t1.warehouse_code in ('GZBLWH', 'QYBLZZ','BLGZ03') or ( t1.warehouse_code in ('YWWH01') and ( t3.`status`=1 or t6.`status`=1 ) ) ) -- 义务仓 只要停止监控 或者停售就推送
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 (@platform!='aliexpress' or t3.`status`=1 or t6.`status`=1 ) -- 速卖通的必须要停止监控才推送
and (@platform!='aliexpress' or t3.`status`=1 or t6.`status`=1 ) -- 速卖通的必须要停止监控才推送