Merge pull request '处理重复数据' (#87) from test into master

Reviewed-on: https://git.oa00.com/recook/backend_v2/pulls/87
master
杨赟 3 years ago
commit 8018630ccd

@ -330,7 +330,7 @@ func (s *supplyLogic) Adopt(data AdoptSkuInfo) error {
if tx.Model(&manage.RecookThirdPartySupply{}).Where("id = ?", thirdPartySupply.Id).Updates(map[string]interface{}{ if tx.Model(&manage.RecookThirdPartySupply{}).Where("id = ?", thirdPartySupply.Id).Updates(map[string]interface{}{
"status": manage.RecookThirdPartySupplyStatusAdopt, "status": manage.RecookThirdPartySupplyStatusAdopt,
"goods_id": recookGoodsSkuModels[0].GoodsId, "goods_id": recookGoodsSkuModels[0].GoodsId,
}).Error != nil { }).RowsAffected != 1 {
return errors.New("入库失败") return errors.New("入库失败")
} }
return nil return nil
@ -468,7 +468,7 @@ func (s *supplyLogic) Adopt(data AdoptSkuInfo) error {
if tx.Model(&manage.RecookThirdPartySupply{}).Where("id = ?", thirdPartySupply.Id).Updates(map[string]interface{}{ if tx.Model(&manage.RecookThirdPartySupply{}).Where("id = ?", thirdPartySupply.Id).Updates(map[string]interface{}{
"status": manage.RecookThirdPartySupplyStatusAdopt, "status": manage.RecookThirdPartySupplyStatusAdopt,
"goods_id": recookGoodsInfoModel.Id, "goods_id": recookGoodsInfoModel.Id,
}).Error != nil { }).RowsAffected != 1 {
return errors.New("入库失败") return errors.New("入库失败")
} }
return nil return nil

Loading…
Cancel
Save