1
This commit is contained in:
@@ -1017,9 +1017,6 @@ func UpdateSkuName(ctx *jxcontext.Context, nameID int, payload map[string]interf
|
||||
|
||||
}
|
||||
}
|
||||
if payload["tiktokAttribute"] != nil {
|
||||
skuName.TiktokAttribute = payload["tiktokAttribute"].(string)
|
||||
}
|
||||
txDB, _ := dao.Begin(db)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
|
||||
@@ -199,13 +199,13 @@ type SkuName struct {
|
||||
// JdSyncStatus int8 `orm:"default(2)" json:"jdSyncStatus"`
|
||||
|
||||
// LinkID int `orm:"column(link_id);null;index" json:"linkID"`
|
||||
YbNameSuffix string `json:"ybNameSuffix"` //银豹商品后缀
|
||||
JdsStockSwitch int8 `orm:"default(1)" json:"jdsStockSwitch"` //京东商城总库存
|
||||
PreparationTime int `orm:"default(1)" json:"preparationTime"` //商品准备时长
|
||||
BestSeller int `json:"bestSeller"` //畅销品 0不是 1是
|
||||
Video string `json:"video"` //商品视频地址
|
||||
VideoID string `orm:"column(video_id)" json:"videoID"` //商品视频美团ID
|
||||
TiktokAttribute string `orm:"column(tiktok_attribute);size(512)" json:"tiktok_attribute"` //抖音分类属性的存储
|
||||
YbNameSuffix string `json:"ybNameSuffix"` //银豹商品后缀
|
||||
JdsStockSwitch int8 `orm:"default(1)" json:"jdsStockSwitch"` //京东商城总库存
|
||||
PreparationTime int `orm:"default(1)" json:"preparationTime"` //商品准备时长
|
||||
BestSeller int `json:"bestSeller"` //畅销品 0不是 1是
|
||||
Video string `json:"video"` //商品视频地址
|
||||
VideoID string `orm:"column(video_id)" json:"videoID"` //商品视频美团ID
|
||||
TiktokAttribute string `orm:"column(tiktok_attribute);size(512)" json:"tiktokAttribute"` //抖音分类属性的存储
|
||||
}
|
||||
|
||||
func (*SkuName) TableUnique() [][]string {
|
||||
|
||||
@@ -53,6 +53,7 @@ func DeSerializeData(strValue string, dataPtr interface{}) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
// mapData 参数 obj 对象
|
||||
// todo 这里看是否需要将key值转换成标准格式(即字母大写),因为beego orm不区分,不转换也可以
|
||||
func FilterMapByStructObject(mapData map[string]interface{}, obj interface{}, objPtr interface{}, excludedFields []string, isCheckValue bool) (valid map[string]interface{}, invalid map[string]interface{}) {
|
||||
excludedMap := make(map[string]int)
|
||||
@@ -66,6 +67,8 @@ func FilterMapByStructObject(mapData map[string]interface{}, obj interface{}, ob
|
||||
if m[k] != nil && excludedMap[k] == 0 /*&& v != nil*/ && (!isCheckValue || !IsValueEqual(m[k], v)) {
|
||||
valid[k] = v
|
||||
m[k] = v
|
||||
globals.SugarLogger.Debugf("m[k]====%s", utils.Format4Output(m[k], false))
|
||||
globals.SugarLogger.Debugf("valid[k] ====%s", utils.Format4Output(valid[k], false))
|
||||
} else {
|
||||
invalid[k] = v
|
||||
}
|
||||
@@ -75,6 +78,9 @@ func FilterMapByStructObject(mapData map[string]interface{}, obj interface{}, ob
|
||||
globals.SugarLogger.Warnf("FilterMapByStructObject failed with err:%v, mapData:%s", err, utils.Format4Output(mapData, true))
|
||||
}
|
||||
}
|
||||
globals.SugarLogger.Debugf("m[valid]====%s", utils.Format4Output(valid, false))
|
||||
globals.SugarLogger.Debugf("m[invalid]====%s", utils.Format4Output(invalid, false))
|
||||
|
||||
return valid, invalid
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user