1
This commit is contained in:
@@ -4,6 +4,8 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
@@ -132,7 +134,9 @@ func BatchInitData(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi *mt
|
||||
foodData["min_order_count"] = 1
|
||||
}
|
||||
foodData["unit"] = storeSku.Unit
|
||||
globals.SugarLogger.Debugf("BatchInitData storeSku=%s", utils.Format4Output(storeSku, false))
|
||||
attr := mtwm.SwitchAttr(toApi, vendorStoreID, int64(storeSku.TagID), 0, storeSku.Name)
|
||||
globals.SugarLogger.Debugf("BatchInitData attr=%s", attr)
|
||||
if attr != "" {
|
||||
foodData["common_attr_value"] = attr
|
||||
}
|
||||
|
||||
@@ -501,7 +501,9 @@ func SwitchAttr(apiObj *mtwmapi.API, vendorStoreID string, vendorCatID int64, na
|
||||
attrValues []CommonAttrValue
|
||||
)
|
||||
if nameID != 0 { //是否为纯创建
|
||||
globals.SugarLogger.Debugf("SwitchAttr nameID=%d", nameID)
|
||||
if tData, err := dao.GetSkuNames(db, []int{nameID}, nil, "", false); err == nil && len(tData) > 0 {
|
||||
globals.SugarLogger.Debugf("SwitchAttr tData=%s", utils.Format4Output(tData, false))
|
||||
if tData[0].MtAttribute != "[]" && tData[0].MtAttribute != "{}" && tData[0].MtAttribute != "" {
|
||||
return tData[0].MtAttribute
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user