Commit 2b1b2f1d by guanzhenshan

同上

parent 0a29b1be
......@@ -12,5 +12,8 @@ namespace Bailun.DC.Models.Sku
public int count { get; set; }
public string platform { get; set; }
public string site { get; set; }
}
}
......@@ -272,7 +272,7 @@ namespace Bailun.DC.Services
/// </summary>
/// <param name="platformsku">平台SKU列表</param>
/// <returns></returns>
public List<dc_base_sku_mapping> GetBailunSkuByPlatformSku(List<string> platformsku,string platform)
public List<dc_base_sku_mapping> GetBailunSkuByPlatformSku(List<string> platformsku)
{
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
......@@ -281,7 +281,7 @@ namespace Bailun.DC.Services
cn.Open();
}
var sql = $"select t1.bailun_sku,t1.platform_sku,t1.count from dc_base_sku_mapping t1 where t1.platform_sku in ('{string.Join("','", platformsku)}') and t1.has_deleted=0 and t1.platform='{platform}' ";
var sql = $"select t1.bailun_sku,t1.platform_sku,t1.count,t1.platform,t1.site from dc_base_sku_mapping t1 where t1.platform_sku in ('{string.Join("','", platformsku)}') and t1.has_deleted=0 ";
return cn.Query<dc_base_sku_mapping>(sql).AsList();
......
......@@ -137,6 +137,8 @@ namespace Bailun.DC.Web.Controllers
var obj = new Services.OrdersServices().ListOrderPlatformSku(page, pagesize, start, end,platform,companyid, ref total);
var _skuService = new Services.SkuInfoServices();
var listBailunSku = _skuService.GetBailunSkuByPlatformSku(obj.Select(a => a.platform_sku).ToList());
var list = obj.Select(a => new {
a.origin_order_id, //平台订单号
......@@ -148,7 +150,7 @@ namespace Bailun.DC.Web.Controllers
a.platform_sku_unit_price, //单价
a.item_id, //itemid
a.platform_sku, //平台sku
bailunskus= _skuService.GetBailunSkuByPlatformSku(obj.Select(b => b.platform_sku).ToList(),a.platform_type)?.Select(c=>c.bailun_sku).ToList()
bailunskus=listBailunSku.Where(b=>b.platform_sku==a.platform_sku && b.platform==a.platform_type && b.site==a.website).Select(c=>c.bailun_sku).Distinct().ToList()
});
return Json(new
......
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