Commit 0f83f3c4 by guanzhenshan

调整平台利润统计报表的退款数据,按发货时间没有统计Ebay站点退款的问题

parent bc6d7a0e
...@@ -4296,38 +4296,52 @@ namespace Bailun.DC.Services ...@@ -4296,38 +4296,52 @@ namespace Bailun.DC.Services
{ {
var sqlparam = new DynamicParameters(); var sqlparam = new DynamicParameters();
var sql = $"select t1.platform_type,{(isUSD? "sum(t1.amount_refund_usd)" : "sum(t1.amount_refund_rmb)")} as amount_refund from dc_base_crm_refund t1 join dc_base_oms_order t2 on t1.origin_order_id=t2.origin_order_id and t2.bailun_order_status!='Canceled' "; var sql = $"select t1.platform_type,{(isUSD? "sum(t1.amount_refund_usd)" : "sum(t1.amount_refund_rmb)")} as amount_refund from dc_base_crm_refund t1 join dc_base_oms_order t2 on t1.origin_order_id=t2.origin_order_id and t2.bailun_order_status!='Canceled' ";
var sql1 = $" union all select t1.platform_type,{(isUSD ? "sum(t1.amount_refund_usd)" : "sum(t1.amount_refund_rmb)")} as amount_refund from dc_base_crm_refund t1 join dc_base_oms_order t2 on t1.origin_order_id=t2.transaction_id and t2.bailun_order_status!='Canceled' ";
sql += " where t1.is_deleted=0 and t1.is_freeze=0 "; sql += " where t1.is_deleted=0 and t1.is_freeze=0 and t1.platform_type!='Ebay' ";
sql1 += " where t1.is_deleted=0 and t1.is_freeze=0 and t1.platform_type='Ebay' ";
if (companyid.HasValue && companyid.Value != 0) if (companyid.HasValue && companyid.Value != 0)
{ {
sql += " and t1.company_id="+companyid.Value; sql += " and t1.company_id="+companyid.Value;
sql1 += " and t1.company_id=" + companyid.Value;
} }
if (!string.IsNullOrWhiteSpace(platform)) if (!string.IsNullOrWhiteSpace(platform))
{ {
sql += " and t1.platform_type=@platform_type"; sql += " and t1.platform_type=@platform_type";
sqlparam.Add("platform_type", platform); sqlparam.Add("platform_type", platform);
sql1 += " and t1.platform_type=@platform_type1";
sqlparam.Add("platform_type1", platform);
} }
if (!string.IsNullOrWhiteSpace(website)) if (!string.IsNullOrWhiteSpace(website))
{ {
sql += " and t1.website=@website"; sql += " and t1.website=@website";
sqlparam.Add("website", website); sqlparam.Add("website", website);
sql1 += " and t1.website=@website1";
sqlparam.Add("website1", website);
} }
if (start.HasValue) if (start.HasValue)
{ {
sql += " and t1.refund_time>=@start"; sql += " and t1.refund_time>=@start";
sqlparam.Add("start", start.Value); sqlparam.Add("start", start.Value);
sql1 += " and t1.refund_time>=@start1";
sqlparam.Add("start1", start.Value);
} }
if (end.HasValue) if (end.HasValue)
{ {
sql += " and t1.refund_time<@end"; sql += " and t1.refund_time<@end";
sqlparam.Add("end", end.Value.AddDays(1)); sqlparam.Add("end", end.Value.AddDays(1));
sql1 += " and t1.refund_time<@end1";
sqlparam.Add("end1", end.Value.AddDays(1));
} }
sql += " group by t1.platform_type"; sql += " group by t1.platform_type";
sql1 += " group by t1.platform_type";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString)) using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{ {
...@@ -4336,7 +4350,7 @@ namespace Bailun.DC.Services ...@@ -4336,7 +4350,7 @@ namespace Bailun.DC.Services
cn.Open(); cn.Open();
} }
var obj = cn.Query<dc_base_oms_order>(sql, sqlparam, null, true, 2 * 60); var obj = cn.Query<dc_base_oms_order>(sql+sql1, sqlparam, null, true, 2 * 60);
return obj.AsList(); return obj.AsList();
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div style="float:right;width:100%;"> <div style="float:right;width:100%;">
<div id="rightcontain"> <div id="rightcontain">
<div class="alert alert-warning"> <div class="alert alert-warning">
说明:退款金额是根据页面的付款时间和发货时间匹配退款时间获取的,只匹配到订单维度 说明:退款数据按发货时间统计时,统计的是时间段内的退款发生额,并且排除已取消订单的退款;按付款时间时,关联订单取退款数据,并去掉取消和拦截的订单退款
</div> </div>
<div class="ibox-content m-b-sm border-bottom"> <div class="ibox-content m-b-sm border-bottom">
......
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