This commit is contained in:
邹宗楠
2023-03-31 19:18:39 +08:00
parent 7d181829a5
commit 98532b94ca

View File

@@ -1182,6 +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)
cats, err := dao.GetCategoriesByName(dao.GetDB(), "", jdCategoryId)
if len(cats) == 0 || err != nil {
return jdsCategoryID, ebaiCategoryID, mtwmCategoryID, 0
@@ -1199,6 +1200,7 @@ func getJDCategoryLoadingLocalCategoryReflex(jdCategoryId, jdsCategoryID, ebaiCa
jxCategoryId = cats[0].ID
}
}
globals.SugarLogger.Debugf("==getJDCategoryLoadingLocalCategoryReflex=== jxCategoryId===222 %d",jxCategoryId)
return jdsCategoryID, ebaiCategoryID, mtwmCategoryID, jxCategoryId
}
@@ -1286,6 +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)
jxCategoryID = int(jxCategoryIDNumber)
} else if payload["categoryID"] != nil && !utils.IsNil(payload["categoryID"]) {
vi := reflect.ValueOf(payload["categoryID"])
@@ -1298,6 +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)
jxCategoryID = int(jxCategoryIDNumber)
} else {
jxCategoryID = 0
@@ -1335,6 +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)
dao.ExecuteSQL(dao.GetDB(), `UPDATE sku_name SET category_id = ? WHERE id = ?`, []interface{}{jxCategoryID, nameID}...)
flag = true
}