mt sku
This commit is contained in:
@@ -353,7 +353,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
}
|
||||
foodData["unit"] = storeSku.Unit
|
||||
//todo 增加商品必填属性
|
||||
attr := SwitchAttr(getAPI(getStoreVendorOrgCode(storeID), storeID, vendorStoreID), vendorStoreID, storeSku.VendorVendorCatID, storeSku.NameID, storeSku.Name, isCreate)
|
||||
attr := SwitchAttr(getAPI(getStoreVendorOrgCode(storeID), storeID, vendorStoreID), vendorStoreID, storeSku.VendorVendorCatID, storeSku.NameID, storeSku.Name)
|
||||
if attr != "" {
|
||||
foodData["common_attr_value"] = attr
|
||||
}
|
||||
@@ -493,14 +493,14 @@ type ValueList struct {
|
||||
Value string `json:"value"` //普通属性值名称(与普通属性值Id一一对应),支持自定义。
|
||||
}
|
||||
|
||||
func SwitchAttr(apiObj *mtwmapi.API, vendorStoreID string, vendorCatID int64, nameID int, name string, isNeed bool) (attrs string) {
|
||||
func SwitchAttr(apiObj *mtwmapi.API, vendorStoreID string, vendorCatID int64, nameID int, name string) (attrs string) {
|
||||
var (
|
||||
db *dao.DaoDB
|
||||
tempCatID int64
|
||||
attrValue CommonAttrValue
|
||||
attrValues []CommonAttrValue
|
||||
)
|
||||
if isNeed == false && nameID != 0 { //是否为纯创建
|
||||
if nameID != 0 { //是否为纯创建
|
||||
if tData, err := dao.GetSkuNames(db, []int{nameID}, nil, "", false); err == nil && len(tData) > 0 {
|
||||
if tData[0].MtAttribute != "[]" && tData[0].MtAttribute != "{}" && tData[0].MtAttribute != "" {
|
||||
return tData[0].MtAttribute
|
||||
|
||||
Reference in New Issue
Block a user