|
|
|
@ -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)){ |
|
|
|
|