1
This commit is contained in:
@@ -967,6 +967,7 @@ func UpdateSkuName(ctx *jxcontext.Context, nameID int, payload map[string]interf
|
|||||||
valid = utils.RemoveGeneralMapKeys(valid, model.FieldSpecQuality, model.FieldSpecUnit)
|
valid = utils.RemoveGeneralMapKeys(valid, model.FieldSpecQuality, model.FieldSpecUnit)
|
||||||
_, hasPlaces := payload["places"]
|
_, hasPlaces := payload["places"]
|
||||||
flag := updateOrCreateSkuVendorCategoryMap(db, ctx, nameID, payload, nil, false)
|
flag := updateOrCreateSkuVendorCategoryMap(db, ctx, nameID, payload, nil, false)
|
||||||
|
globals.SugarLogger.Debugf("-------updateOrCreateSkuVendorCategoryMap := %s", utils.Format4Output(payload, false))
|
||||||
if len(valid) > 0 || hasPlaces || flag {
|
if len(valid) > 0 || hasPlaces || flag {
|
||||||
if valid["Upc"] != nil {
|
if valid["Upc"] != nil {
|
||||||
//if upc, _ := valid["Upc"].(string); upc == "" {
|
//if upc, _ := valid["Upc"].(string); upc == "" {
|
||||||
@@ -1287,7 +1288,6 @@ func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, n
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
globals.SugarLogger.Debugf("------jdCategoryId := %s", jdCategoryId)
|
|
||||||
if payload["jdsCategoryID"] != nil {
|
if payload["jdsCategoryID"] != nil {
|
||||||
value, ok := payload["jdCategoryID"].(string)
|
value, ok := payload["jdCategoryID"].(string)
|
||||||
if ok && value != "" && value != "0" {
|
if ok && value != "" && value != "0" {
|
||||||
@@ -1387,7 +1387,6 @@ func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, n
|
|||||||
updateOrCreate(model.VendorIDJD, nameID, jdCategoryId)
|
updateOrCreate(model.VendorIDJD, nameID, jdCategoryId)
|
||||||
flag = true
|
flag = true
|
||||||
payload["jdCategoryID"] = jdCategoryId
|
payload["jdCategoryID"] = jdCategoryId
|
||||||
globals.SugarLogger.Debugf("------jdCategoryId := %s", jdCategoryId)
|
|
||||||
}
|
}
|
||||||
if jxCategoryID != 0 && jxCategoryID != 291 {
|
if jxCategoryID != 0 && jxCategoryID != 291 {
|
||||||
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}...)
|
||||||
@@ -1395,6 +1394,7 @@ func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, n
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("---------payload := %s", utils.Format4Output(payload, false))
|
||||||
return flag
|
return flag
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user