Browse Source

更新商品

master
Lemon 5 years ago
parent
commit
207ab36285
  1. 8
      app/Service/v3/Implementations/GoodsService.php

8
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();
}

Loading…
Cancel
Save