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.

43 lines
924 B

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Request\v3;
  4. use App\Request\BaseFormRequest;
  5. class SearchGoodsRequest extends BaseFormRequest
  6. {
  7. /**
  8. * Get the validation rules that apply to the request.
  9. */
  10. public function rules(): array
  11. {
  12. return [
  13. 'market_id' => 'required|nonempty|integer',
  14. 'type_id' => 'nonempty|integer',
  15. 'store_id' => 'nonempty|integer',
  16. 'keyword' => 'nonempty',
  17. 'order_by' => 'nonempty|in:default,sales,price',
  18. 'sort' => 'nonempty|in:asc,desc',
  19. 'page' => 'nonempty|integer',
  20. 'pagesize' => 'nonempty|integer',
  21. ];
  22. }
  23. /**
  24. * @return array
  25. */
  26. public function messages(): array
  27. {
  28. return [
  29. '*.*' => ':attribute无效',
  30. ];
  31. }
  32. public function attributes(): array
  33. {
  34. return parent::attributes();
  35. }
  36. }