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.
44 lines
964 B
44 lines
964 B
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Request\v3;
|
|
|
|
use App\Request\BaseFormRequest;
|
|
|
|
class SearchGoodsRequest extends BaseFormRequest
|
|
{
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'market_id' => 'required|nonempty|integer',
|
|
'type_id' => 'nonempty',
|
|
'goods_category_ids' => 'nonempty',
|
|
'store_id' => 'nonempty|integer',
|
|
'keyword' => 'nonempty',
|
|
'order_by' => 'nonempty|in:default,sales,price',
|
|
'sort' => 'nonempty|in:asc,desc',
|
|
'page' => 'nonempty|integer',
|
|
'pagesize' => 'nonempty|integer',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'*.*' => ':attribute无效',
|
|
];
|
|
}
|
|
|
|
public function attributes(): array
|
|
{
|
|
return parent::attributes();
|
|
}
|
|
}
|