From c8a53efa0fa4e93ef8c5e9f6c99acac83bf2f483 Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Sun, 14 Aug 2022 04:02:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsku=20saleAttrs=E7=BC=BA?= =?UTF-8?q?=E5=B0=91=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BBWY.Server.Business/PlatformSDK/JDBusiness.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs index 71e6f2ab..78370a6a 100644 --- a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs @@ -132,20 +132,12 @@ namespace BBWY.Server.Business if (rep_skuList.IsError) throw new BusinessException(string.IsNullOrEmpty(rep_skuList.ErrorMsg) ? rep_skuList.ErrMsg : rep_skuList.ErrorMsg); - if (rep_skuList.Json == null || - !rep_skuList.Json.ContainsKey("jingdong_sku_read_searchSkuList_responce") || - rep_skuList.Json["jingdong_sku_read_searchSkuList_responce"]["page"] == null || - rep_skuList.Json["jingdong_sku_read_searchSkuList_responce"]["page"]["data"] == null) - { - return new ProductSkuResponse[0]; - } - return ((JArray)rep_skuList.Json["jingdong_sku_read_searchSkuList_responce"]["page"]["data"]).Select(s => new ProductSkuResponse() { Id = s.Value("skuId"), ProductId = s.Value("wareId"), Price = s.Value("jdPrice"), - Title = string.Join("-", s["saleAttrs"].Select(a => a["attrValueAlias"][0].ToString())), + Title = s["saleAttrs"] != null ? string.Join("-", s["saleAttrs"].Select(a => a["attrValueAlias"][0].ToString())) : string.Empty, Logo = $"https://img13.360buyimg.com/n9/s80x80_{s.Value("logo")}", State = s.Value("status"), CreateTime = s.Value("created").StampToDateTime()