4
0
Fork 0
master
panliang 2022-09-29 17:37:48 +08:00
parent 726b2c7cb9
commit bbade99e74
2 changed files with 3 additions and 3 deletions

View File

@ -33,10 +33,10 @@ class GoodsService
public function generateSku(Goods $goods, $options = [])
{
$spec = data_get($options, 'spec', $goods->spec);
$price = data_get($options, 'price', $goods->price);
$price = floatval(data_get($options, 'price', $goods->price));
$name = data_get($options, 'name', $goods->name);
$stock = data_get($options, 'stock', $goods->stock);
$stock = intval(data_get($options, 'stock', $goods->stock));
$nameAdd = (bool) data_get($options, 'name_add', false);
$priceAdd = (bool) data_get($options, 'price_add', false);
if ($spec) {

View File

@ -204,7 +204,7 @@ class GoodsSkuController extends Controller
$form->disableResetButton();
$form->saving(function (Form $form) use ($goods) {
$price = $form->price;
$price = is_string($form->price) ? str_replace(',', '', $form->price) : $form->price;;
$name = $form->name;
$spec = [];
if ($goods->spec) {