1
This commit is contained in:
@@ -1182,6 +1182,7 @@ func getCategoryByImg(img ...string) string {
|
|||||||
|
|
||||||
// 根据平台返回的分类id,获取本地绑定的映射分类id
|
// 根据平台返回的分类id,获取本地绑定的映射分类id
|
||||||
func getJDCategoryLoadingLocalCategoryReflex(jdCategoryId, jdsCategoryID, ebaiCategoryID, mtwmCategoryID string, jxCategoryId int) (string, string, string, int) {
|
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)
|
cats, err := dao.GetCategoriesByName(dao.GetDB(), "", jdCategoryId)
|
||||||
if len(cats) == 0 || err != nil {
|
if len(cats) == 0 || err != nil {
|
||||||
return jdsCategoryID, ebaiCategoryID, mtwmCategoryID, 0
|
return jdsCategoryID, ebaiCategoryID, mtwmCategoryID, 0
|
||||||
@@ -1199,6 +1200,7 @@ func getJDCategoryLoadingLocalCategoryReflex(jdCategoryId, jdsCategoryID, ebaiCa
|
|||||||
jxCategoryId = cats[0].ID
|
jxCategoryId = cats[0].ID
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("==getJDCategoryLoadingLocalCategoryReflex=== jxCategoryId===222 %d",jxCategoryId)
|
||||||
return jdsCategoryID, ebaiCategoryID, mtwmCategoryID, jxCategoryId
|
return jdsCategoryID, ebaiCategoryID, mtwmCategoryID, jxCategoryId
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1286,6 +1288,7 @@ func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, n
|
|||||||
default:
|
default:
|
||||||
jxCategoryIDNumber, _ = payload["categoryID2"].(json.Number).Int64()
|
jxCategoryIDNumber, _ = payload["categoryID2"].(json.Number).Int64()
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("===========categoryID2 1 %d",jxCategoryIDNumber)
|
||||||
jxCategoryID = int(jxCategoryIDNumber)
|
jxCategoryID = int(jxCategoryIDNumber)
|
||||||
} else if payload["categoryID"] != nil && !utils.IsNil(payload["categoryID"]) {
|
} else if payload["categoryID"] != nil && !utils.IsNil(payload["categoryID"]) {
|
||||||
vi := reflect.ValueOf(payload["categoryID"])
|
vi := reflect.ValueOf(payload["categoryID"])
|
||||||
@@ -1298,6 +1301,7 @@ func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, n
|
|||||||
default:
|
default:
|
||||||
jxCategoryIDNumber, _ = payload["categoryID"].(json.Number).Int64()
|
jxCategoryIDNumber, _ = payload["categoryID"].(json.Number).Int64()
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("===========categoryID 2 %d",jxCategoryIDNumber)
|
||||||
jxCategoryID = int(jxCategoryIDNumber)
|
jxCategoryID = int(jxCategoryIDNumber)
|
||||||
} else {
|
} else {
|
||||||
jxCategoryID = 0
|
jxCategoryID = 0
|
||||||
@@ -1335,6 +1339,7 @@ func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, n
|
|||||||
flag = true
|
flag = true
|
||||||
}
|
}
|
||||||
if jxCategoryID != 0 && jxCategoryID != 291 {
|
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}...)
|
dao.ExecuteSQL(dao.GetDB(), `UPDATE sku_name SET category_id = ? WHERE id = ?`, []interface{}{jxCategoryID, nameID}...)
|
||||||
flag = true
|
flag = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user