1
This commit is contained in:
@@ -300,3 +300,52 @@ func (c *BiddingController) UpdateStockBySkuID() {
|
||||
return
|
||||
})
|
||||
}
|
||||
|
||||
// RefreshSkuNameMTAttr 更新商品库美团属性进口为国产
|
||||
// @Title 更新商品库美团属性进口为国产
|
||||
// @Description 批量更新库存
|
||||
// @Param token header string true "认证token"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /RefreshSkuNameMTAttr [get]
|
||||
func (c *BiddingController) RefreshSkuNameMTAttre() {
|
||||
c.callGetRefundOrderList(func(params *tBindGetRefundOrderListParams) (retVal interface{}, hint string, err error) {
|
||||
db := dao.GetDB()
|
||||
nameList, err := dao.GetSkuNamesByAttr(db, "1300000004")
|
||||
if err != nil {
|
||||
return retVal, hint, err
|
||||
}
|
||||
for _, v := range nameList {
|
||||
attr := make([]*AttrList, 0, 0)
|
||||
if err = json.Unmarshal([]byte(v.MtAttribute), attr); err != nil {
|
||||
return retVal, hint, err
|
||||
}
|
||||
|
||||
for _, v2 := range attr {
|
||||
if v2.AttrId == 1200000132 {
|
||||
for _, v3 := range v2.ValueList {
|
||||
if v3.ValueId == 1300000004 {
|
||||
v3.ValueId = 1300000003
|
||||
v3.Value = "国产"
|
||||
|
||||
byteV2, _ := json.Marshal(v2)
|
||||
dao.UpdateSkuNameMtAttr(db, int64(v.ID), string(byteV2))
|
||||
break
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
return retVal, hint, err
|
||||
})
|
||||
}
|
||||
|
||||
type AttrList struct {
|
||||
AttrId int `json:"attr_id"`
|
||||
AttrName string `json:"attr_name"`
|
||||
ValueList []struct {
|
||||
ValueId int `json:"value_id"`
|
||||
Value string `json:"value"`
|
||||
} `json:"valueList"`
|
||||
}
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"git.rosy.net.cn/baseapi/platformapi/jdapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/auth2"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
|
||||
"errors"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
@@ -1032,7 +1029,6 @@ func (c *StoreSkuController) GetVendorStoreSkus() {
|
||||
// @router /GetStoresSkusForStore [get]
|
||||
func (c *StoreSkuController) GetStoresSkusForStore() {
|
||||
c.callGetStoresSkusForStore(func(params *tStoreSkuGetStoresSkusForStoreParams) (retVal interface{}, errCode string, err error) {
|
||||
globals.SugarLogger.Debugf("daata :======%s", utils.Format4Output(params.MapData, false))
|
||||
retVal, err = cms.GetStoresSkusForStore(params.Ctx, params.StoreID, params.IsFocus, params.IsAct, params.Keyword, params.CategoryID, params.Status, params.Offset, params.PageSize, params.Stock, params.LocationCode, params.LocationCode2)
|
||||
return retVal, "", err
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user