varsql=@"select platform_type,seller_account,website,sum(amount_product*seller_order_exchange_rate) 'amount_product',sum(cost_product) 'cost_product',sum(cost_platform_fee*seller_order_exchange_rate) 'platform_fee',sum(cost_first) 'head_fee',count(id) 'order_count',sum(cost_total) 'cost_count',sum(cost_shipping) 'nofba_logisticsfee',sum(profit_total) 'profit_count',(sum(profit_total)/sum(amount_total*seller_order_exchange_rate)) 'profit_rate',sum(amount_prepaid) amount_prepaid,sum(amount_refund*seller_order_exchange_rate) amount_refund,sum(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee,sum(cost_paypal_fee*seller_order_exchange_rate) cost_paypal_fee,sum(cost_package) cost_package from dc_base_oms_order where paid_time>='"+start.ToString("yyyy-MM-dd")+"' and paid_time<'"+end.AddDays(1).ToString("yyyy-MM-dd")+"' and platform_type='FBA' and bailun_order_status!='Canceled' ";
varsql=@"select platform_type,seller_account,website,sum(amount_sales*seller_order_exchange_rate) 'amount_product',sum(cost_product) 'cost_product',sum(cost_platform_fee*seller_order_exchange_rate) 'platform_fee',sum(cost_first) 'head_fee',count(id) 'order_count',sum(cost_total) 'cost_count',sum(cost_shipping) 'nofba_logisticsfee',sum(profit_total) 'profit_count',(sum(profit_total)/sum(amount_total*seller_order_exchange_rate)) 'profit_rate',sum(amount_prepaid) amount_prepaid,sum(amount_refund*seller_order_exchange_rate) amount_refund,sum(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee,sum(cost_paypal_fee*seller_order_exchange_rate) cost_paypal_fee,sum(cost_package) cost_package,count(amount_prepaid>0 or null) as noshippingcount from dc_base_oms_order where paid_time>='"+start.ToString("yyyy-MM-dd")+"' and paid_time<'"+end.AddDays(1).ToString("yyyy-MM-dd")+"' and platform_type='FBA' and bailun_order_status!='Canceled' ";
if(!string.IsNullOrWhiteSpace(account))
{
...
...
@@ -337,7 +337,7 @@ namespace Bailun.DC.Services
{
varsqlparam=newDynamicParameters();
varsql=@"select sum(amount_product*seller_order_exchange_rate) 'amount_product',sum(cost_product) 'cost_product',sum(cost_platform_fee*seller_order_exchange_rate) 'platform_fee',sum(cost_first) 'head_fee',count(id) 'order_count',sum(cost_total) 'cost_count',sum(cost_shipping) 'nofba_logisticsfee',sum(profit_total) 'profit_count',(sum(profit_total)/sum(amount_product*seller_order_exchange_rate)) 'profit_rate',sum(amount_prepaid) amount_prepaid,sum(amount_refund*seller_order_exchange_rate) amount_refund,sum(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee,sum(cost_paypal_fee*seller_order_exchange_rate) cost_paypal_fee,sum(cost_package) cost_package from dc_base_oms_order where paid_time>='"+start.ToString("yyyy-MM-dd")+"' and paid_time<'"+end.AddDays(1).ToString("yyyy-MM-dd")+"' and platform_type='FBA' and bailun_order_status!='Canceled' ";
varsql=@"select sum(amount_sales*seller_order_exchange_rate) 'amount_product',sum(cost_product) 'cost_product',sum(cost_platform_fee*seller_order_exchange_rate) 'platform_fee',sum(cost_first) 'head_fee',count(id) 'order_count',sum(cost_total) 'cost_count',sum(cost_shipping) 'nofba_logisticsfee',sum(profit_total) 'profit_count',(sum(profit_total)/sum(amount_product*seller_order_exchange_rate)) 'profit_rate',sum(amount_prepaid) amount_prepaid,sum(amount_refund*seller_order_exchange_rate) amount_refund,sum(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee,sum(cost_paypal_fee*seller_order_exchange_rate) cost_paypal_fee,sum(cost_package) cost_package,count(amount_prepaid>0 or null) as noshippingcount from dc_base_oms_order where paid_time>='"+start.ToString("yyyy-MM-dd")+"' and paid_time<'"+end.AddDays(1).ToString("yyyy-MM-dd")+"' and platform_type='FBA' and bailun_order_status!='Canceled' ";
varsql="select tb.platform_type,count(tb.bailun_order_id) order_count,sum(tb.amount_sales*seller_order_exchange_rate) as amount_sales,sum(tb.cost_platform_fee*seller_order_exchange_rate) as cost_platform_fee,sum(cost_first) as cost_first,sum(cost_tail) cost_tail,sum(cost_handle_bailun) cost_handle_bailun,sum(cost_handle_platform) cost_handle_platform,sum(tb.profit_total) as profit_total,(sum(tb.profit_total)/sum(tb.amount_sales)) profitrate ,sum(amount_refund*seller_order_exchange_rate) amount_refund,sum(cost_product) cost_product,sum(profit_total) profit_total,(sum(profit_total)/sum(tb.amount_sales*seller_order_exchange_rate)) profit_rate from dc_base_oms_order tb where bailun_order_status!='Canceled'";
varsql="select tb.platform_type,count(tb.bailun_order_id) order_count,sum(tb.amount_sales*seller_order_exchange_rate) as amount_sales,sum(tb.cost_platform_fee*seller_order_exchange_rate) as cost_platform_fee,sum(cost_first) as cost_first,sum(cost_tail) cost_tail,sum(cost_handle_bailun) cost_handle_bailun,sum(cost_handle_platform) cost_handle_platform,sum(tb.profit_total) as profit_total,(sum(tb.profit_total)/sum(tb.amount_sales)) profitrate ,sum(amount_refund*seller_order_exchange_rate) amount_refund,sum(cost_product) cost_product,sum(profit_total) profit_total,(sum(profit_total)/sum(tb.amount_sales*seller_order_exchange_rate)) profit_rate,count(amount_prepaid>0 or null) as noshippingcount from dc_base_oms_order tb ";
varpresql="select platform_type,sum(amount_prepaid) amount_prepaid from dc_base_oms_sku where bailun_order_status!='Canceled' and amount_prepaid>0 ";
if(shipstart.HasValue)
{
sql+=" left join dc_base_oms_pick t1 on tb.bailun_order_id "