diff --git a/internal/v2/logic/third/supply.go b/internal/v2/logic/third/supply.go index e9aa62c..22a8533 100644 --- a/internal/v2/logic/third/supply.go +++ b/internal/v2/logic/third/supply.go @@ -330,7 +330,7 @@ func (s *supplyLogic) Adopt(data AdoptSkuInfo) error { if tx.Model(&manage.RecookThirdPartySupply{}).Where("id = ?", thirdPartySupply.Id).Updates(map[string]interface{}{ "status": manage.RecookThirdPartySupplyStatusAdopt, "goods_id": recookGoodsSkuModels[0].GoodsId, - }).Error != nil { + }).RowsAffected != 1 { return errors.New("入库失败") } 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{}{ "status": manage.RecookThirdPartySupplyStatusAdopt, "goods_id": recookGoodsInfoModel.Id, - }).Error != nil { + }).RowsAffected != 1 { return errors.New("入库失败") } return nil