1
This commit is contained in:
@@ -25,7 +25,7 @@ func SendVendorV2(data SendData) (err error) {
|
|||||||
if data.VendorID == model.VendorIDMTWM {
|
if data.VendorID == model.VendorIDMTWM {
|
||||||
dataStr, _ := json.Marshal(data.Data)
|
dataStr, _ := json.Marshal(data.Data)
|
||||||
temp := string(dataStr)
|
temp := string(dataStr)
|
||||||
fmt.Println(temp)
|
globals.SugarLogger.Debugf("SendVendorV2 temp=%s", temp)
|
||||||
if _, err = api.MtwmAPI.MsgSend(string(dataStr)); err != nil {
|
if _, err = api.MtwmAPI.MsgSend(string(dataStr)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -495,10 +495,9 @@ type ValueList struct {
|
|||||||
|
|
||||||
func SwitchAttr(apiObj *mtwmapi.API, vendorStoreID string, vendorCatID int64, nameID int, name string) (attrs string) {
|
func SwitchAttr(apiObj *mtwmapi.API, vendorStoreID string, vendorCatID int64, nameID int, name string) (attrs string) {
|
||||||
var (
|
var (
|
||||||
db *dao.DaoDB
|
db *dao.DaoDB
|
||||||
tempCatID int64
|
tempCatID int64
|
||||||
attrValue CommonAttrValue
|
attrValue CommonAttrValue
|
||||||
attrValues []CommonAttrValue
|
|
||||||
)
|
)
|
||||||
if nameID != 0 { //是否为纯创建
|
if nameID != 0 { //是否为纯创建
|
||||||
if tData, err := dao.GetSkuNames(db, []int{nameID}, nil, "", false); err == nil && len(tData) > 0 {
|
if tData, err := dao.GetSkuNames(db, []int{nameID}, nil, "", false); err == nil && len(tData) > 0 {
|
||||||
@@ -516,6 +515,7 @@ func SwitchAttr(apiObj *mtwmapi.API, vendorStoreID string, vendorCatID int64, na
|
|||||||
}
|
}
|
||||||
//根据类目id获取类目属性列表
|
//根据类目id获取类目属性列表
|
||||||
if attrList, err := apiObj.CategoryAttrList(tempCatID); err == nil && len(attrList) > 0 {
|
if attrList, err := apiObj.CategoryAttrList(tempCatID); err == nil && len(attrList) > 0 {
|
||||||
|
globals.SugarLogger.Debugf("SwitchAttr attrList==================%s", utils.Format4Output(attrList, false))
|
||||||
for _, v := range attrList {
|
for _, v := range attrList {
|
||||||
if v.Need == mtwmapi.NeedYes {
|
if v.Need == mtwmapi.NeedYes {
|
||||||
attrValue = CommonAttrValue{
|
attrValue = CommonAttrValue{
|
||||||
@@ -539,6 +539,7 @@ func SwitchAttr(apiObj *mtwmapi.API, vendorStoreID string, vendorCatID int64, na
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var attrValues []CommonAttrValue
|
||||||
attrValues = append(attrValues, attrValue)
|
attrValues = append(attrValues, attrValue)
|
||||||
temp, _ := json.Marshal(attrValues)
|
temp, _ := json.Marshal(attrValues)
|
||||||
attrs = string(temp)
|
attrs = string(temp)
|
||||||
|
|||||||
Reference in New Issue
Block a user