diff --git a/app/Service/v3/Implementations/GoodsService.php b/app/Service/v3/Implementations/GoodsService.php index 396275e..833dd75 100644 --- a/app/Service/v3/Implementations/GoodsService.php +++ b/app/Service/v3/Implementations/GoodsService.php @@ -85,8 +85,12 @@ class GoodsService implements GoodsServiceInterface if(isset($params['name']) && !empty($params['name'])) { $goods->name = $params['name']; } - $goods->price = $params['price']; - $goods->on_sale = $params['on_sale']; + if(isset($params['price']) && !empty($params['price'])) { + $goods->price = $params['price']; + } + if(isset($params['on_sale']) && !empty($params['on_sale'])) { + $goods->on_sale = $params['on_sale']; + } return $goods->save(); }