You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.2 KiB
51 lines
1.2 KiB
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Request\v3;
|
|
|
|
use App\Request\BaseFormRequest;
|
|
|
|
class GoodsEditorRequest extends BaseFormRequest
|
|
{
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'id' => 'required',
|
|
'market_id' => 'required|nonempty|integer',
|
|
'store_id' => 'required|nonempty|integer',
|
|
'name' => 'required|nonempty',
|
|
'category_id' => 'required|nonempty|integer',
|
|
'goods_unit' => 'required|nonempty',
|
|
'price' => 'required|nonempty',
|
|
'original_price' => 'required|nonempty',
|
|
'is_infinite' => 'required',
|
|
'inventory' => 'required',
|
|
'restrict_num' => 'required',
|
|
'start_num' => 'required',
|
|
'spec' => 'required|nonempty',
|
|
'tags' => 'required|nonempty',
|
|
'remark' => 'required|nonempty',
|
|
'on_sale' => 'required',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'*.*' => ':attribute无效',
|
|
];
|
|
}
|
|
|
|
public function attributes(): array
|
|
{
|
|
return parent::attributes();
|
|
}
|
|
}
|