This commit is contained in:
苏尹岚
2021-03-17 09:21:57 +08:00
parent 71a11a333e
commit 2b53dbb708
4 changed files with 40 additions and 19 deletions

View File

@@ -5278,11 +5278,11 @@ func DeleteActStoreSkuBind(ctx *jxcontext.Context, db *dao.DaoDB, actID int, act
func GetVendorStoreSkus(ctx *jxcontext.Context, storeID, vendorID int) (err error) {
type SpecialtyStoreSkus struct {
Upc int `json:"商品upc码"`
SkuName string `json:"商品名"`
Unit int `json:"单位"`
Weight float64 `json:"重量(g)"`
Price float64 `json:"售价"`
Upc string `json:"商品upc码"`
SkuName string `json:"商品名"`
Unit string `json:"单位"`
Weight int `json:"重量(g)"`
Price int64 `json:"售价"`
}
var (
db = dao.GetDB()
@@ -5309,9 +5309,15 @@ func GetVendorStoreSkus(ctx *jxcontext.Context, storeID, vendorID int) (err erro
handler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.ISingleStoreStoreSkuHandler)
skuList, _ := handler.GetStoreSkusFullInfo(ctx, nil, storeID, storeDetail.VendorStoreID, nil)
for _, sku := range skuList {
if sku.SkuList[0].IsSpecialty == model.YES {
specialtyStoreSku := &SpecialtyStoreSkus{}
specialtyStoreSkus = append(specialtyStoreSkus, specialtyStoreSku)
if sku.UPC != "" {
skus := &SpecialtyStoreSkus{
Upc: sku.UPC,
SkuName: sku.Name,
Unit: sku.Unit,
Weight: sku.SkuList[0].Weight,
Price: sku.SkuList[0].VendorPrice,
}
specialtyStoreSkus = append(specialtyStoreSkus, skus)
}
}
}