This commit is contained in:
邹宗楠
2023-03-31 19:24:24 +08:00
parent 98532b94ca
commit 2df2fe9282

View File

@@ -1182,7 +1182,7 @@ func getCategoryByImg(img ...string) string {
// 根据平台返回的分类id,获取本地绑定的映射分类id
func getJDCategoryLoadingLocalCategoryReflex(jdCategoryId, jdsCategoryID, ebaiCategoryID, mtwmCategoryID string, jxCategoryId int) (string, string, string, int) {
globals.SugarLogger.Debugf("==getJDCategoryLoadingLocalCategoryReflex=== jxCategoryId=== %d",jxCategoryId)
globals.SugarLogger.Debugf("==getJDCategoryLoadingLocalCategoryReflex=== jxCategoryId=== %d", jxCategoryId)
cats, err := dao.GetCategoriesByName(dao.GetDB(), "", jdCategoryId)
if len(cats) == 0 || err != nil {
return jdsCategoryID, ebaiCategoryID, mtwmCategoryID, 0
@@ -1200,7 +1200,7 @@ func getJDCategoryLoadingLocalCategoryReflex(jdCategoryId, jdsCategoryID, ebaiCa
jxCategoryId = cats[0].ID
}
}
globals.SugarLogger.Debugf("==getJDCategoryLoadingLocalCategoryReflex=== jxCategoryId===222 %d",jxCategoryId)
globals.SugarLogger.Debugf("==getJDCategoryLoadingLocalCategoryReflex=== jxCategoryId===222 %d", jxCategoryId)
return jdsCategoryID, ebaiCategoryID, mtwmCategoryID, jxCategoryId
}
@@ -1288,7 +1288,7 @@ func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, n
default:
jxCategoryIDNumber, _ = payload["categoryID2"].(json.Number).Int64()
}
globals.SugarLogger.Debugf("===========categoryID2 1 %d",jxCategoryIDNumber)
globals.SugarLogger.Debugf("===========categoryID2 1 %d", jxCategoryIDNumber)
jxCategoryID = int(jxCategoryIDNumber)
} else if payload["categoryID"] != nil && !utils.IsNil(payload["categoryID"]) {
vi := reflect.ValueOf(payload["categoryID"])
@@ -1301,7 +1301,7 @@ func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, n
default:
jxCategoryIDNumber, _ = payload["categoryID"].(json.Number).Int64()
}
globals.SugarLogger.Debugf("===========categoryID 2 %d",jxCategoryIDNumber)
globals.SugarLogger.Debugf("===========categoryID 2 %d", jxCategoryIDNumber)
jxCategoryID = int(jxCategoryIDNumber)
} else {
jxCategoryID = 0
@@ -1339,7 +1339,7 @@ func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, n
flag = true
}
if jxCategoryID != 0 && jxCategoryID != 291 {
globals.SugarLogger.Debugf("===========categoryID 2 %d",jxCategoryID)
globals.SugarLogger.Debugf("===========categoryID 2 %d", jxCategoryID)
dao.ExecuteSQL(dao.GetDB(), `UPDATE sku_name SET category_id = ? WHERE id = ?`, []interface{}{jxCategoryID, nameID}...)
flag = true
}
@@ -2551,6 +2551,8 @@ func CreateUpcSkuByExcelBin(ctx *jxcontext.Context, reader io.Reader, categoryID
if !isUpdate {
_, err = AddSkuName(ctx, skuName, ctx.GetUserName())
} else {
globals.SugarLogger.Debugf("============sku== %s", utils.Format4Output(sku, false))
globals.SugarLogger.Debugf("============skuName== %s", utils.Format4Output(skuName, false))
sku.Name = skuName.Name
sku.Img = skuName.Img
sku.Img2 = skuName.Img2