调整编辑sku,spu销售值为空报错情况
parent
ad92afb21a
commit
9421752e63
|
|
@ -125,7 +125,12 @@ class ProductSkuController extends AdminController
|
||||||
}
|
}
|
||||||
return bcmul($vipPrice, 100);
|
return bcmul($vipPrice, 100);
|
||||||
});
|
});
|
||||||
$form->currency('sales_value')->symbol('@')->default(0);
|
$form->currency('sales_value')->symbol('@')->default(0)->saving(function ($salesValue) {
|
||||||
|
if (is_null($salesValue)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return $salesValue;
|
||||||
|
});
|
||||||
$form->divider();
|
$form->divider();
|
||||||
$form->select('attr_group')->options(ProductGroup::all()->pluck('name', 'id'));
|
$form->select('attr_group')->options(ProductGroup::all()->pluck('name', 'id'));
|
||||||
$form->selectAttr('attrs')->listen('attr_group');
|
$form->selectAttr('attrs')->listen('attr_group');
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,12 @@ class ProductSpuController extends AdminController
|
||||||
}
|
}
|
||||||
return bcmul($vipPrice, 100);
|
return bcmul($vipPrice, 100);
|
||||||
});
|
});
|
||||||
$form->currency('sales_value')->symbol('@')->default(0);
|
$form->currency('sales_value')->symbol('@')->default(0)->saving(function ($salesValue) {
|
||||||
|
if (is_null($salesValue)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return $salesValue;
|
||||||
|
});
|
||||||
$form->divider();
|
$form->divider();
|
||||||
$form->select('attr_group')->options(ProductGroup::all()->pluck('name', 'id'));
|
$form->select('attr_group')->options(ProductGroup::all()->pluck('name', 'id'));
|
||||||
$form->selectAttr('attrs')->listen('attr_group');
|
$form->selectAttr('attrs')->listen('attr_group');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue