1
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
"math"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -1278,30 +1277,28 @@ func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, n
|
||||
mtwmCategoryID = payload["mtwmCategoryID"].(string)
|
||||
}
|
||||
if payload["categoryID2"] != nil && !utils.IsNil(payload["categoryID2"]) {
|
||||
vi := reflect.ValueOf(payload["categoryID2"])
|
||||
var jxCategoryIDNumber int64
|
||||
switch vi.Kind() {
|
||||
case reflect.String:
|
||||
jxCategoryIDNumber = utils.Str2Int64(payload["categoryID2"].(string))
|
||||
case reflect.Int64, reflect.Int:
|
||||
jxCategoryIDNumber, _ = payload["categoryID2"].(int64)
|
||||
default:
|
||||
jxCategoryIDNumber, _ = payload["categoryID2"].(json.Number).Int64()
|
||||
if value, ok := payload["categoryID2"].(string); ok {
|
||||
jxCategoryIDNumber = utils.Str2Int64(value)
|
||||
}
|
||||
if value, ok := payload["categoryID2"].(int64); ok {
|
||||
jxCategoryIDNumber = value
|
||||
}
|
||||
if value, ok := payload["categoryID2"].(json.Number); ok {
|
||||
jxCategoryIDNumber, _ = value.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"])
|
||||
var jxCategoryIDNumber int64
|
||||
switch vi.Kind() {
|
||||
case reflect.String:
|
||||
jxCategoryIDNumber = utils.Str2Int64(payload["categoryID"].(string))
|
||||
case reflect.Int64, reflect.Int:
|
||||
jxCategoryIDNumber, _ = payload["categoryID"].(int64)
|
||||
default:
|
||||
jxCategoryIDNumber, _ = payload["categoryID"].(json.Number).Int64()
|
||||
if value, ok := payload["categoryID"].(string); ok {
|
||||
jxCategoryIDNumber = utils.Str2Int64(value)
|
||||
}
|
||||
if value, ok := payload["categoryID"].(int64); ok {
|
||||
jxCategoryIDNumber = value
|
||||
}
|
||||
if value, ok := payload["categoryID"].(json.Number); ok {
|
||||
jxCategoryIDNumber, _ = value.Int64()
|
||||
}
|
||||
globals.SugarLogger.Debugf("===========categoryID 2 %d", jxCategoryIDNumber)
|
||||
jxCategoryID = int(jxCategoryIDNumber)
|
||||
} else {
|
||||
jxCategoryID = 0
|
||||
@@ -1339,7 +1336,6 @@ 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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user