原价和成本价必须是数字

This commit is contained in:
Edward Yang 2022-08-30 16:14:25 +08:00
parent 0ba62d4ada
commit ed6eea3382
3 changed files with 9 additions and 2 deletions

View File

@ -34,10 +34,11 @@ class ProductRequest extends FormRequest
{
return [
'descriptions.*.name' => 'required|string|min:3|max:128',
// 'descriptions.*.description' => 'required|string',
'brand_id' => 'int',
'skus.*.sku' => 'required|string',
'skus.*.price' => 'required|numeric',
'skus.*.origin_price' => 'required|numeric',
'skus.*.cost_price' => 'required|numeric',
];
}
@ -47,7 +48,9 @@ class ProductRequest extends FormRequest
'descriptions.*.name' => trans('product.name'),
'brand_id' => trans('product.brand'),
'skus.*.sku' => trans('product.sku'),
'skus.*.price' => trans('product.price')
'skus.*.price' => trans('product.price'),
'skus.*.origin_price' => trans('product.origin_price'),
'skus.*.cost_price' => trans('product.cost_price'),
];
}
}

View File

@ -13,6 +13,8 @@ return [
'name' => 'Name',
'sku' => 'SKU',
'price' => 'Price',
'origin_price' => 'Origin Price',
'cost_price' => 'Cost Price',
'brand' => 'Brand',
'category' => 'Category',
'model' => 'Model',

View File

@ -13,6 +13,8 @@ return [
'name' => '名称',
'sku' => 'SKU',
'price' => '价格',
'origin_price' => '原价',
'cost_price' => '成本价',
'brand' => '品牌',
'category' => '分类',
'model' => '型号',