Commit 5061544e by guanzhenshan

调整平台sku销量接口

parent c4e8d24b
...@@ -3355,7 +3355,15 @@ namespace Bailun.DC.Services ...@@ -3355,7 +3355,15 @@ namespace Bailun.DC.Services
if (!string.IsNullOrEmpty(platform)) if (!string.IsNullOrEmpty(platform))
{ {
sql += $" and platform_type = '{platform}'"; if (platform.ToUpper() == "AMAZON")
{
sql += $" and platform_type in ('{platform}','FBA')";
}
else
{
sql += $" and platform_type = '{platform}'";
}
} }
if (skus.Length > 0) if (skus.Length > 0)
......
...@@ -496,6 +496,49 @@ namespace Bailun.DC.Web.Controllers ...@@ -496,6 +496,49 @@ namespace Bailun.DC.Web.Controllers
} }
/// <summary> /// <summary>
/// 获取Sku的销售数据
/// </summary>
/// <param name="page">页码</param>
/// <param name="start">开始时间</param>
/// <param name="end">结束时间</param>
/// <param name="skus">sku数组</param>
/// <param name="platform">平台</param>
/// <returns></returns>
[HttpPost]
public JsonResult SkuSales(int page, DateTime start, DateTime end, string skus, string platform = "Ebay")
{
int pagesize = 1000;
try
{
var obj = new Services.OrdersServices().ListEbaySkuSalesCount(page, pagesize, start, end, skus.Split(','), platform);
return Json(new
{
success = true,
msg = "",
data = obj.Select(a => new {
a.platform_type,
a.website,
a.bailun_sku,
count = a.bailun_sku_quantity_ordered,
amount = a.amount_sales
})
});
}
catch (Exception ex)
{
return Json(new
{
success = false,
msg = "出现异常,异常信息:" + ex.Message
});
}
}
/// <summary>
/// 根据时间段获取采购单明细 /// 根据时间段获取采购单明细
/// </summary> /// </summary>
/// <param name="page">当前页码</param> /// <param name="page">当前页码</param>
......
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