修改状态

master
kanade 3 years ago
parent 87ce3357c4
commit 3c2bb41343

@ -281,7 +281,7 @@ func (s *supplyLogic) Adopt(data AdoptSkuInfo) error {
} }
inventory := 0 inventory := 0
if thirdPartySupply.Status == manage.RecookThirdPartySupplySupplyStatusUp { if thirdPartySupply.SupplyStatus == manage.RecookThirdPartySupplySupplyStatusUp {
inventory = 500 inventory = 500
} }
// sku信息处理 // sku信息处理
@ -419,7 +419,7 @@ func (s *supplyLogic) Adopt(data AdoptSkuInfo) error {
} }
inventory := 0 inventory := 0
if thirdPartySupply.Status == manage.RecookThirdPartySupplySupplyStatusUp { if thirdPartySupply.SupplyStatus == manage.RecookThirdPartySupplySupplyStatusUp {
inventory = 500 inventory = 500
} }
// sku信息处理 // sku信息处理
@ -483,9 +483,9 @@ func (s *supplyLogic) SyncPrice(skuIds []uint) error {
for _, partySupply := range thirdPartySupplies { for _, partySupply := range thirdPartySupplies {
mysql.Db.Transaction(func(tx *gorm.DB) error { mysql.Db.Transaction(func(tx *gorm.DB) error {
if tx.Model(&partySupply).Updates(map[string]interface{}{ if tx.Model(&partySupply).Updates(map[string]interface{}{
"price": partySupply.Price, "price": mSkuPrice[partySupply.SupplySkuId].Price,
"guide_price": partySupply.GuidePrice, "guide_price": mSkuPrice[partySupply.SupplySkuId].GuidePrice,
"supply_status": partySupply.Status, "supply_status": mSkuPrice[partySupply.SupplySkuId].Status,
}).Error != nil { }).Error != nil {
return errors.New("更新失败") return errors.New("更新失败")
} }
@ -493,7 +493,7 @@ func (s *supplyLogic) SyncPrice(skuIds []uint) error {
if partySupply.Status == manage.RecookThirdPartySupplyStatusAdopt { if partySupply.Status == manage.RecookThirdPartySupplyStatusAdopt {
// 上游上下架修改库存 // 上游上下架修改库存
inventory := 0 inventory := 0
if partySupply.Status == manage.RecookThirdPartySupplySupplyStatusUp { if mSkuPrice[partySupply.SupplySkuId].Status == manage.RecookThirdPartySupplySupplyStatusUp {
inventory = 500 inventory = 500
} }
if tx.Model(&goods.RecookGoodsSkuModel{}).Where("third_party_type = ? and third_party_sku_id = ?", goods.RecookGoodsInfoThirdPartyTypeSupply, partySupply.SupplySkuId).Updates(map[string]interface{}{ if tx.Model(&goods.RecookGoodsSkuModel{}).Where("third_party_type = ? and third_party_sku_id = ?", goods.RecookGoodsInfoThirdPartyTypeSupply, partySupply.SupplySkuId).Updates(map[string]interface{}{
@ -527,28 +527,28 @@ func (s *supplyLogic) SyncData(skuIds []uint) error {
// 更新商品 // 更新商品
mysql.Db.Transaction(func(tx *gorm.DB) error { mysql.Db.Transaction(func(tx *gorm.DB) error {
if tx.Model(&partySupply).Updates(map[string]interface{}{ if tx.Model(&partySupply).Updates(map[string]interface{}{
"name": partySupply.Name, "name": skuInfo.Name,
"brand_id": partySupply.BrandId, "brand_id": skuInfo.BrandId,
"brand_name": partySupply.BrandName, "brand_name": skuInfo.BrandName,
"first_category_id": partySupply.FirstCategoryId, "first_category_id": skuInfo.FirstCategoryId,
"first_category_name": partySupply.FirstCategoryName, "first_category_name": skuInfo.FirstCategoryName,
"second_category_id": partySupply.SecondCategoryId, "second_category_id": skuInfo.SecondCategoryId,
"second_category_name": partySupply.SecondCategoryName, "second_category_name": skuInfo.SecondCategoryName,
"third_category_id": partySupply.ThirdCategoryId, "third_category_id": skuInfo.ThirdCategoryId,
"third_category_name": partySupply.ThirdCategoryName, "third_category_name": skuInfo.ThirdCategoryName,
"price": partySupply.Price, "price": skuInfo.Price,
"guide_price": partySupply.GuidePrice, "guide_price": skuInfo.GuidePrice,
"img_url": partySupply.ImgUrl, "img_url": skuInfo.ImgUrl,
"profit": partySupply.Profit, "profit": skuInfo.Profit,
"size": partySupply.Size, "size": skuInfo.Size,
"color": partySupply.Color, "color": skuInfo.Color,
"tax": partySupply.Tax, "tax": skuInfo.Tax,
"tax_code": partySupply.TaxCode, "tax_code": skuInfo.TaxCode,
"tax_name": partySupply.TaxName, "tax_name": skuInfo.TaxName,
"unit": partySupply.Unit, "unit": skuInfo.Unit,
"upc_code": partySupply.UpcCode, "upc_code": skuInfo.UpcCode,
"content": partySupply.Content, "content": skuInfo.Content,
"supply_status": partySupply.Status, "supply_status": skuInfo.Status,
}).Error != nil { }).Error != nil {
return errors.New("更新失败") return errors.New("更新失败")
} }
@ -665,7 +665,7 @@ func (s *supplyLogic) SyncData(skuIds []uint) error {
// 上游上下架修改库存 // 上游上下架修改库存
inventory := 0 inventory := 0
if partySupply.Status == manage.RecookThirdPartySupplySupplyStatusUp { if skuInfo.Status == manage.RecookThirdPartySupplySupplyStatusUp {
inventory = 500 inventory = 500
} }
if tx.Model(&goods.RecookGoodsSkuModel{}).Where("third_party_type = ? and third_party_sku_id = ?", goods.RecookGoodsInfoThirdPartyTypeSupply, partySupply.SupplySkuId).Updates(map[string]interface{}{ if tx.Model(&goods.RecookGoodsSkuModel{}).Where("third_party_type = ? and third_party_sku_id = ?", goods.RecookGoodsInfoThirdPartyTypeSupply, partySupply.SupplySkuId).Updates(map[string]interface{}{

Loading…
Cancel
Save