diff --git a/app/Service/v3/Implementations/GoodsService.php b/app/Service/v3/Implementations/GoodsService.php index 2350987..08f0c32 100644 --- a/app/Service/v3/Implementations/GoodsService.php +++ b/app/Service/v3/Implementations/GoodsService.php @@ -78,9 +78,9 @@ class GoodsService implements GoodsServiceInterface public function update($params) { - $goods = Goods::find($params['id']); + $goods = Goods::query()->withoutGlobalScope('normal')->find($params['id']); if (empty($goods)) { - return ErrorCode::GOODS_NOT_EXISTS; + throw new ErrorCodeException( ErrorCode::GOODS_NOT_EXISTS); } foreach ($params as $k => $v){ if(isset($goods->$k)){