This commit is contained in:
邹宗楠
2025-05-09 14:57:37 +08:00
parent 7a5a2f3e85
commit 02ad420313
2 changed files with 4 additions and 4 deletions

View File

@@ -185,7 +185,7 @@ func skuInfo2Param(ctx *jxcontext.Context, sku *dao.StoreSkuSyncInfo) (param *jd
param.Images = jxutils.BatchString2Slice(sku.Img, sku.Img2, sku.Img3, sku.Img4, sku.Img5)
}
if sku.SkuVendorMapCatID != "" {
if sku.SkuVendorMapCatID != "" && sku.SkuVendorMapCatID != "0" {
param.CategoryID = utils.Str2Int64(sku.SkuVendorMapCatID)
} else if sku.VendorVendorCatID != 0 {
param.CategoryID = sku.VendorVendorCatID
@@ -196,7 +196,7 @@ func skuInfo2Param(ctx *jxcontext.Context, sku *dao.StoreSkuSyncInfo) (param *jd
if recommendCategory != nil && recommendCategory.CategoryId != model.NO {
param.CategoryID = int64(recommendCategory.CategoryId)
dao.ExecuteSQL(dao.GetDB(), ` UPDATE sku_vendor_category_map SET vendor_category_id = ? WHERE name_id = ? AND vendor_id = ? `, []interface{}{recommendCategory.CategoryId, sku.NameID, sku.VendorID}...)
dao.ExecuteSQL(dao.GetDB(), ` UPDATE sku_category SET jd_category_id = ? WHERE id = ? `, []interface{}{recommendCategory.CategoryId, sku.LocalCategoryId}...)
//dao.ExecuteSQL(dao.GetDB(), ` UPDATE sku_category SET jd_category_id = ? WHERE id = ? `, []interface{}{recommendCategory.CategoryId, sku.LocalCategoryId}...)
dao.ExecuteSQL(dao.GetDB(), ` UPDATE sku_name SET jd_category_id = ? WHERE id = ? `, []interface{}{recommendCategory.CategoryId, sku.NameID})
}
}