Commit 7bc50a6c by guanzhenshan

解决数据中心按sku分类筛选时,出现数据异常的问题

parent 21cc3b6f
...@@ -1536,7 +1536,7 @@ namespace Bailun.DC.Services ...@@ -1536,7 +1536,7 @@ namespace Bailun.DC.Services
if (!string.IsNullOrWhiteSpace(skucategoryids)) if (!string.IsNullOrWhiteSpace(skucategoryids))
{ {
sql += @" join dc_base_oms_sku t3 on tb.bailun_order_id=t3.bailun_order_id sql += @" join (select distinct bailun_order_id from dc_base_oms_sku t3
join dc_base_sku t4 on t3.bailun_sku=t4.bailun_sku join dc_base_sku t4 on t3.bailun_sku=t4.bailun_sku
"; ";
...@@ -1559,6 +1559,33 @@ namespace Bailun.DC.Services ...@@ -1559,6 +1559,33 @@ namespace Bailun.DC.Services
sql += " and t4.category_simple_id in (" + s + ")"; sql += " and t4.category_simple_id in (" + s + ")";
} }
} }
sql += " where t3.bailun_order_status!='Canceled' and ((t3.platform_type!='FBA' and t3.bailun_order_status!='CantHandle') or t3.platform_type='FBA') and t3.has_scalp=0 and t3.has_innersale=0 and t3.bailun_interception_status in ('None','Failed') and t3.has_delete=0 ";
if (companyid.HasValue && companyid.Value > 0)
{
sql += " and t3.company_id=" + companyid.Value; //增加公司id过滤
}
if (!string.IsNullOrWhiteSpace(platform))
{
sql += " and t3.platform_type='"+ platform + "'";
}
if (!string.IsNullOrWhiteSpace(website))
{
sql += " and t3.website='"+website+"'";
}
if (start.HasValue)
{
sql += " and t3.paid_time>='"+start.Value.ToString("yyyy-MM-dd")+"'";
}
if (end.HasValue)
{
sql += " and t3.paid_time<'"+end.Value.AddDays(1).ToString("yyyy-MM-dd")+"'";
}
sql += ") t33 on tb.bailun_order_id=t33.bailun_order_id";
} }
sql += " where tb.bailun_order_status!='Canceled' and ((tb.platform_type!='FBA' and tb.bailun_order_status!='CantHandle') or tb.platform_type='FBA') and tb.has_scalp=0 and tb.has_innersale=0 and tb.bailun_interception_status in ('None','Failed') "; sql += " where tb.bailun_order_status!='Canceled' and ((tb.platform_type!='FBA' and tb.bailun_order_status!='CantHandle') or tb.platform_type='FBA') and tb.has_scalp=0 and tb.has_innersale=0 and tb.bailun_interception_status in ('None','Failed') ";
......
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