From fc588aec6062857548c564e0ff31412b1762a278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 20 Dec 2019 11:56:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=B9=B3=E5=8F=B0=E9=97=A8?= =?UTF-8?q?=E5=BA=97=E5=95=86=E5=93=81=E4=BB=B7=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store_sku.go | 36 ++++++++++++++++--------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 393dcf2da..122ad6a70 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -2550,24 +2550,26 @@ func GetVendorStoreSkuPrice(ctx *jxcontext.Context, vendorIDs []int, skuID int, } inStoreSkuList = append(inStoreSkuList, inStoreSku) outStoreSkuList, err := handler.GetStoreSkusBareInfo(ctx, v, task, 0, vendorStoreID, inStoreSkuList) - if err != nil { - data := DataVendorStoreSkuPrice{ - StoreID: vendorStoreID, - StoreName: storeDetail.Name, - SkuID: skuID, - SkuName: skuNameList[0].Name, - VendorPrice: "", + if storeDetail != nil { + if len(outStoreSkuList) == 0 { + data := DataVendorStoreSkuPrice{ + StoreID: vendorStoreID, + StoreName: storeDetail.Name, + SkuID: skuID, + SkuName: skuNameList[0].Name, + VendorPrice: "", + } + retVal = []DataVendorStoreSkuPrice{data} + } else { + data := DataVendorStoreSkuPrice{ + StoreID: vendorStoreID, + StoreName: storeDetail.Name, + SkuID: skuID, + SkuName: skuNameList[0].Name, + VendorPrice: utils.Float64ToStr(utils.Str2Float64(utils.Int64ToStr(outStoreSkuList[0].VendorPrice)) / 100), + } + retVal = []DataVendorStoreSkuPrice{data} } - retVal = []DataVendorStoreSkuPrice{data} - } else { - data := DataVendorStoreSkuPrice{ - StoreID: vendorStoreID, - StoreName: storeDetail.Name, - SkuID: skuID, - SkuName: skuNameList[0].Name, - VendorPrice: utils.Float64ToStr(utils.Str2Float64(utils.Int64ToStr(outStoreSkuList[0].VendorPrice)) / 100), - } - retVal = []DataVendorStoreSkuPrice{data} } return retVal, err }