1
This commit is contained in:
@@ -137,12 +137,12 @@ func (p *PurchaseHandler) getVendorCategories(level int, pid int64) (vendorCats
|
||||
}
|
||||
if level > 1 {
|
||||
cat.ParentID = utils.Int64ToStr(v.ParentId)
|
||||
if level == 3 {
|
||||
if level == 3 || level == 4 {
|
||||
cat.IsLeaf = 1
|
||||
}
|
||||
}
|
||||
vendorCats = append(vendorCats, cat)
|
||||
if level < 3 {
|
||||
if level < 4 {
|
||||
childVendorCats, err2 := p.getVendorCategories(level+1, v.Id)
|
||||
if err2 == nil && len(childVendorCats) > 0 {
|
||||
vendorCats = append(vendorCats, childVendorCats...)
|
||||
@@ -185,11 +185,6 @@ func skuInfo2Param(ctx *jxcontext.Context, sku *dao.StoreSkuSyncInfo) (param *jd
|
||||
param.Images = jxutils.BatchString2Slice(sku.Img, sku.Img2, sku.Img3, sku.Img4, sku.Img5)
|
||||
}
|
||||
|
||||
switch sku.NameID {
|
||||
case 8080661, 8080665, 8080667, 8080670:
|
||||
globals.SugarLogger.Debugf("--------sku := %s", utils.Format4Output(sku, false))
|
||||
}
|
||||
|
||||
if sku.SkuVendorMapCatID != "" && sku.SkuVendorMapCatID != "0" {
|
||||
param.CategoryID = utils.Str2Int64(sku.SkuVendorMapCatID)
|
||||
} else if sku.VendorVendorCatID != 0 {
|
||||
@@ -217,11 +212,6 @@ func skuInfo2Param(ctx *jxcontext.Context, sku *dao.StoreSkuSyncInfo) (param *jd
|
||||
param.ProductDesc = fmt.Sprintf(`<img src="%s" alt="一张图片" />`, sku.DescImg)
|
||||
}
|
||||
|
||||
switch sku.NameID {
|
||||
case 8080661, 8080665, 8080667, 8080670:
|
||||
globals.SugarLogger.Debugf("--------param := %s", utils.Format4Output(param, false))
|
||||
}
|
||||
|
||||
return param
|
||||
}
|
||||
|
||||
@@ -229,10 +219,6 @@ func (p *PurchaseHandler) CreateSku2(ctx *jxcontext.Context, sku *dao.StoreSkuSy
|
||||
param := skuInfo2Param(ctx, sku)
|
||||
if globals.EnableJdStoreWrite {
|
||||
sku.VendorSkuID, err = getAPI(sku.VendorOrgCode).AddSku2(param)
|
||||
switch sku.NameID {
|
||||
case 8080661, 8080665, 8080667, 8080670:
|
||||
globals.SugarLogger.Debugf("--------err := %v", utils.Format4Output(err, false))
|
||||
}
|
||||
if err != nil && strings.Contains(err.Error(), jdapi.ErrMustUPC) {
|
||||
result, err2 := getAPI(sku.VendorOrgCode).BatchAddSkuByUPC([]*jdapi.CreateByUpcParam2{
|
||||
&jdapi.CreateByUpcParam2{
|
||||
|
||||
Reference in New Issue
Block a user